mirror of
https://github.com/python/cpython.git
synced 2025-09-17 22:20:23 +00:00
Fix refleak introduced in rev. 51248.
This commit is contained in:
parent
1ce433e937
commit
26a07b5198
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue