summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMeador Inge <meadori@gmail.com>2011-09-28 01:52:04 (GMT)
committerMeador Inge <meadori@gmail.com>2011-09-28 01:52:04 (GMT)
commit48d49497c50e79d14e9df9527d766ca3a0a38be5 (patch)
tree5eb9cc6eceb40d26e0d4630bfb9b3d6d16d0a007 /Modules
parentf0c51fabe8eaf462317bfe49d3ae442f3162e914 (diff)
parentb86ecf4bd1bfe237fbaa7ac8098af76141b5caf1 (diff)
downloadcpython-48d49497c50e79d14e9df9527d766ca3a0a38be5.zip
cpython-48d49497c50e79d14e9df9527d766ca3a0a38be5.tar.gz
cpython-48d49497c50e79d14e9df9527d766ca3a0a38be5.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 0c6f542..3df26da 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