Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
Patch by Suman Saha.
This commit is contained in:
parent
ff337ccd4b
commit
c39cd783fb
|
@ -90,6 +90,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
|
||||||
|
Patch by Suman Saha.
|
||||||
|
|
||||||
- Issue #13979: A bug in ctypes.util.find_library that caused
|
- Issue #13979: A bug in ctypes.util.find_library that caused
|
||||||
the wrong library name to be returned has been fixed.
|
the wrong library name to be returned has been fixed.
|
||||||
|
|
||||||
|
|
|
@ -1475,8 +1475,10 @@ defdict_repr(defdictobject *dd)
|
||||||
{
|
{
|
||||||
int status = Py_ReprEnter(dd->default_factory);
|
int status = Py_ReprEnter(dd->default_factory);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
if (status < 0)
|
if (status < 0) {
|
||||||
|
Py_DECREF(baserepr);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
defrepr = PyString_FromString("...");
|
defrepr = PyString_FromString("...");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue