From: Thomas Heller Date: Fri, 13 Jul 2007 19:52:41 +0000 (+0000) Subject: PyType_stgdict() returns a borrowed reference which must not be X-Git-Tag: v2.5.2c1~239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b78594b1f5a1a876f1abd54429006f34b69cf1d;p=python PyType_stgdict() returns a borrowed reference which must not be Py_DECREF'd. --- diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c index 5651d6260a..19e3b3c3e6 100644 --- a/Modules/_ctypes/stgdict.c +++ b/Modules/_ctypes/stgdict.c @@ -465,13 +465,11 @@ StructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct) if (!prop) { Py_DECREF(pair); - Py_DECREF((PyObject *)stgdict); return -1; } if (-1 == PyDict_SetItem(realdict, name, prop)) { Py_DECREF(prop); Py_DECREF(pair); - Py_DECREF((PyObject *)stgdict); return -1; } Py_DECREF(pair);