mirror of
https://github.com/python/cpython.git
synced 2025-07-31 23:23:11 +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;
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue