Commit 26a07b51 authored by Georg Brandl's avatar Georg Brandl

Fix refleak introduced in rev. 51248.

parent 1ce433e9
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment