#3694: fix an "XXX undetected error" leak in struct.

This commit is contained in:
Georg Brandl 2009-02-13 11:01:07 +00:00
parent c8dcfb6cec
commit 75c3d6ff09
2 changed files with 5 additions and 1 deletions

View file

@ -1785,7 +1785,7 @@ s_pack_into(PyObject *self, PyObject *args)
assert( buffer_len >= 0 );
/* Extract the offset from the first argument */
offset = PyLong_AsSsize_t(PyTuple_GET_ITEM(args, 1));
offset = PyNumber_AsSsize_t(PyTuple_GET_ITEM(args, 1), PyExc_IndexError);
if (offset == -1 && PyErr_Occurred())
return NULL;