diff options
| author | Meador Inge <meadori@gmail.com> | 2011-09-27 20:45:30 -0500 |
|---|---|---|
| committer | Meador Inge <meadori@gmail.com> | 2011-09-27 20:45:30 -0500 |
| commit | b86ecf4bd1bfe237fbaa7ac8098af76141b5caf1 (patch) | |
| tree | 8f35d013193a4a4d18e4dcbbfe9a00ed7e3a835d /Modules | |
| parent | 6fb44728bb36d1d0f40155a295ecb15696351b33 (diff) | |
| download | cpython-git-b86ecf4bd1bfe237fbaa7ac8098af76141b5caf1.tar.gz | |
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 17a00f5c19..8f378e246d 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 |
