mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
PyLong_FromString(): Nailed a small memory leak. In the str==start
test, we forgot that z is still pointing to a real live object. DECREF() it before returning.
This commit is contained in:
parent
aa2aea0e79
commit
b5cebfe164
1 changed files with 1 additions and 0 deletions
|
@ -769,6 +769,7 @@ PyLong_FromString(str, pend, base)
|
|||
if (str == start) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"no digits in long int constant");
|
||||
Py_DECREF(z);
|
||||
return NULL;
|
||||
}
|
||||
if (sign < 0 && z != NULL && z->ob_size != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue