From c9b9de17976a4832f505309b1096f9a7582c7be9 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Wed, 11 Jul 2007 12:18:46 +0000 Subject: [PATCH] PyType_stgdict() returns a borrowed reference which must not be Py_DECREF'd. This bug should be fixed in trunk and release25-maint also. --- Modules/_ctypes/stgdict.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c index 07e142bdfe0..c35a5154e96 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);