From: Thomas Heller Date: Fri, 13 Jul 2007 19:51:55 +0000 (+0000) Subject: PyType_stgdict() returns a borrowed reference which must not be X-Git-Tag: v2.6a1~1569 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe31d77dc0b70c18f1cffa98861da3a2f995241a;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 b72bf67b33..cfa72ef764 100644 --- a/Modules/_ctypes/stgdict.c +++ b/Modules/_ctypes/stgdict.c @@ -469,13 +469,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);