summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMeador Inge <meadori@gmail.com>2011-09-28 01:45:30 (GMT)
committerMeador Inge <meadori@gmail.com>2011-09-28 01:45:30 (GMT)
commitb86ecf4bd1bfe237fbaa7ac8098af76141b5caf1 (patch)
tree8f35d013193a4a4d18e4dcbbfe9a00ed7e3a835d /Modules
parent6fb44728bb36d1d0f40155a295ecb15696351b33 (diff)
downloadcpython-b86ecf4bd1bfe237fbaa7ac8098af76141b5caf1.zip
cpython-b86ecf4bd1bfe237fbaa7ac8098af76141b5caf1.tar.gz
cpython-b86ecf4bd1bfe237fbaa7ac8098af76141b5caf1.tar.bz2
Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
Thanks to Suman Saha for finding the bug and providing a patch.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/_ctypes.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 17a00f5..8f378e2 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -4474,6 +4474,7 @@ PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length)
if (!PyType_Check(itemtype)) {
PyErr_SetString(PyExc_TypeError,
"Expected a type object");
+ Py_DECREF(key);
return NULL;
}
#ifdef MS_WIN64