mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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) {
|
if (str == start) {
|
||||||
PyErr_SetString(PyExc_ValueError,
|
PyErr_SetString(PyExc_ValueError,
|
||||||
"no digits in long int constant");
|
"no digits in long int constant");
|
||||||
|
Py_DECREF(z);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (sign < 0 && z != NULL && z->ob_size != 0)
|
if (sign < 0 && z != NULL && z->ob_size != 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue