diff options
author | Meador Inge <meadori@gmail.com> | 2011-09-28 01:45:30 (GMT) |
---|---|---|
committer | Meador Inge <meadori@gmail.com> | 2011-09-28 01:45:30 (GMT) |
commit | b86ecf4bd1bfe237fbaa7ac8098af76141b5caf1 (patch) | |
tree | 8f35d013193a4a4d18e4dcbbfe9a00ed7e3a835d /Modules | |
parent | 6fb44728bb36d1d0f40155a295ecb15696351b33 (diff) | |
download | cpython-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.c | 1 |
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 |