diff options
author | Georg Brandl <georg@python.org> | 2006-08-14 20:25:39 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-08-14 20:25:39 (GMT) |
commit | 26a07b5198e47d7874eef14e15dee2cc0e644cb9 (patch) | |
tree | 43691f3b2d396febd7633ff6cd5bd746b1a8b96d /Objects | |
parent | 1ce433e937952447218787962ec9d552f9661088 (diff) | |
download | cpython-26a07b5198e47d7874eef14e15dee2cc0e644cb9.zip cpython-26a07b5198e47d7874eef14e15dee2cc0e644cb9.tar.gz cpython-26a07b5198e47d7874eef14e15dee2cc0e644cb9.tar.bz2 |
Fix refleak introduced in rev. 51248.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 2189a82..f3ef4b8 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -4226,8 +4226,10 @@ _PyString_FormatLong(PyObject *val, int flags, int prec, int type, return NULL; buf = PyString_AsString(result); - if (!buf) + if (!buf) { + Py_DECREF(result); return NULL; + } /* To modify the string in-place, there can only be one reference. */ if (result->ob_refcnt != 1) { |