From: Christian Heimes Date: Mon, 10 Sep 2012 01:00:14 +0000 (+0200) Subject: Fixed possible reference leak to mod when type_name() returns NULL X-Git-Tag: v3.2.4rc1~551 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0e7e41cba6c75f493a64ce09037cecb60642190;p=thirdparty%2FPython%2Fcpython.git Fixed possible reference leak to mod when type_name() returns NULL --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 1bda375c3d26..e34b10ce40a0 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -647,8 +647,10 @@ type_repr(PyTypeObject *type) mod = NULL; } name = type_name(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);