Commit c39cd783 authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #13015: Fix a possible reference leak in defaultdict.__repr__.

Patch by Suman Saha.
parent ff337ccd
......@@ -90,6 +90,9 @@ Core and Builtins
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
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);
if (status != 0) {
if (status < 0)
if (status < 0) {
Py_DECREF(baserepr);
return NULL;
}
defrepr = PyString_FromString("...");
}
else
......
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