mirror of
https://github.com/python/cpython.git
synced 2025-09-14 12:46:49 +00:00
Fixed a memory leak introduced in r62462
This commit is contained in:
parent
ec924c995c
commit
bcd2c08e11
1 changed files with 3 additions and 1 deletions
|
@ -670,8 +670,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
|
||||||
if (float_argument_error(arg))
|
if (float_argument_error(arg))
|
||||||
return converterr("integer<n>", arg, msgbuf, bufsize);
|
return converterr("integer<n>", arg, msgbuf, bufsize);
|
||||||
iobj = PyNumber_Index(arg);
|
iobj = PyNumber_Index(arg);
|
||||||
if (iobj != NULL)
|
if (iobj != NULL) {
|
||||||
ival = PyLong_AsSsize_t(iobj);
|
ival = PyLong_AsSsize_t(iobj);
|
||||||
|
Py_DECREF(iobj);
|
||||||
|
}
|
||||||
if (ival == -1 && PyErr_Occurred())
|
if (ival == -1 && PyErr_Occurred())
|
||||||
return converterr("integer<n>", arg, msgbuf, bufsize);
|
return converterr("integer<n>", arg, msgbuf, bufsize);
|
||||||
*p = ival;
|
*p = ival;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue