Skip to content

Commit b5cebfe

Browse files
committed
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.
1 parent aa2aea0 commit b5cebfe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Objects/longobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ PyLong_FromString(str, pend, base)
769769
if (str == start) {
770770
PyErr_SetString(PyExc_ValueError,
771771
"no digits in long int constant");
772+
Py_DECREF(z);
772773
return NULL;
773774
}
774775
if (sign < 0 && z != NULL && z->ob_size != 0)

0 commit comments

Comments
 (0)