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 | |
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.
-rw-r--r-- | Misc/ACKS | 1 | ||||
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 1 |
3 files changed, 5 insertions, 0 deletions
@@ -774,6 +774,7 @@ Sam Rushing Mark Russell Nick Russo Sébastien Sablé +Suman Saha Hajime Saitou George Sakkis Rich Salz @@ -82,6 +82,9 @@ Tests Extension Modules ----------------- +- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype. + Thanks to Suman Saha for finding the bug and providing a patch. + - Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that file descriptor was actually received. 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 |