mirror of https://github.com/python/cpython.git
Fix refleak introduced in rev. 51248.
This commit is contained in:
parent
1ce433e937
commit
26a07b5198
|
@ -4226,8 +4226,10 @@ _PyString_FormatLong(PyObject *val, int flags, int prec, int type,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
buf = PyString_AsString(result);
|
buf = PyString_AsString(result);
|
||||||
if (!buf)
|
if (!buf) {
|
||||||
|
Py_DECREF(result);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* To modify the string in-place, there can only be one reference. */
|
/* To modify the string in-place, there can only be one reference. */
|
||||||
if (result->ob_refcnt != 1) {
|
if (result->ob_refcnt != 1) {
|
||||||
|
|
Loading…
Reference in New Issue