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

Skip to content

Commit 48d4949

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.
2 parents f0c51fa + b86ecf4 commit 48d4949

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
@@ -828,6 +828,7 @@ Mark Russell
828828
Nick Russo
829829
Patrick Sabin
830830
Sébastien Sablé
831+
Suman Saha
831832
Hajime Saitou
832833
George Sakkis
833834
Rich Salz

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,9 @@ Tools/Demos
12951295
Extension Modules
12961296
-----------------
12971297

1298+
- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
1299+
Thanks to Suman Saha for finding the bug and providing a patch.
1300+
12981301
- Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that
12991302
file descriptor was actually received.
13001303

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)