From: Barry Warsaw Date: Wed, 27 Jan 1999 17:48:27 +0000 (+0000) Subject: PyLong_FromString(): Nailed a small memory leak. In the str==start X-Git-Tag: v1.5.2b2~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5cebfe164fbf6c862e8aa9fb91628d1b8cf76be;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Objects/longobject.c b/Objects/longobject.c index 834b8a875213..7c805a5259f6 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -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)