From: Christian Heimes Date: Mon, 10 Sep 2012 01:01:16 +0000 (+0200) Subject: Fixed possible reference leak to mod when type_name() returns NULL X-Git-Tag: v3.3.1rc1~818^2^2~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=455657961e78d0019bb789ccd0b5f5a94a262e18;p=python Fixed possible reference leak to mod when type_name() returns NULL --- 455657961e78d0019bb789ccd0b5f5a94a262e18 diff --cc Objects/typeobject.c index bd55ede5ff,e34b10ce40..f51700e034 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@@ -690,9 -646,11 +690,11 @@@ type_repr(PyTypeObject *type Py_DECREF(mod); mod = NULL; } - name = type_name(type, NULL); + name = type_qualname(type, NULL); - if (name == NULL) + if (name == NULL) { + Py_XDECREF(mod); return NULL; + } if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins")) rtn = PyUnicode_FromFormat("", mod, name);