Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b86ecf4

Browse files
committed
Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
Thanks to Suman Saha for finding the bug and providing a patch.
1 parent 6fb4472 commit b86ecf4

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ Sam Rushing
774774
Mark Russell
775775
Nick Russo
776776
Sébastien Sablé
777+
Suman Saha
777778
Hajime Saitou
778779
George Sakkis
779780
Rich Salz

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ Tests
8282
Extension Modules
8383
-----------------
8484

85+
- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
86+
Thanks to Suman Saha for finding the bug and providing a patch.
87+
8588
- Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that
8689
file descriptor was actually received.
8790

Modules/_ctypes/_ctypes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4474,6 +4474,7 @@ PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length)
44744474
if (!PyType_Check(itemtype)) {
44754475
PyErr_SetString(PyExc_TypeError,
44764476
"Expected a type object");
4477+
Py_DECREF(key);
44774478
return NULL;
44784479
}
44794480
#ifdef MS_WIN64

0 commit comments

Comments
 (0)