Skip to content

Commit 710dcfd

Browse files
stratakisvstinner
authored andcommitted
[2.7] bpo-13096: Fix memory leak in ctypes POINTER handling of large values (GH-12100)
1 parent 67988d1 commit 710dcfd

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix memory leak in ctypes POINTER handling of large values.

Modules/_ctypes/callproc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,6 +1831,7 @@ POINTER(PyObject *self, PyObject *cls)
18311831
"s(O){}",
18321832
buf,
18331833
&PyCPointer_Type);
1834+
PyMem_Free(buf);
18341835
if (result == NULL)
18351836
return result;
18361837
key = PyLong_FromVoidPtr(result);

0 commit comments

Comments
 (0)