From: stratakis Date: Mon, 4 Mar 2019 15:40:25 +0000 (+0100) Subject: [2.7] bpo-13096: Fix memory leak in ctypes POINTER handling of large values (GH-12100) X-Git-Tag: v2.7.17rc1~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=710dcfd2f4bee034894a39026388f9c21ea976f1;p=thirdparty%2FPython%2Fcpython.git [2.7] bpo-13096: Fix memory leak in ctypes POINTER handling of large values (GH-12100) --- diff --git a/Misc/NEWS.d/next/Library/2019-03-04-16-13-01.bpo-13096.SGPt_n.rst b/Misc/NEWS.d/next/Library/2019-03-04-16-13-01.bpo-13096.SGPt_n.rst new file mode 100644 index 000000000000..2bf49c855f60 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-03-04-16-13-01.bpo-13096.SGPt_n.rst @@ -0,0 +1 @@ +Fix memory leak in ctypes POINTER handling of large values. diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 209734208578..defcde1ff3e9 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1831,6 +1831,7 @@ POINTER(PyObject *self, PyObject *cls) "s(O){}", buf, &PyCPointer_Type); + PyMem_Free(buf); if (result == NULL) return result; key = PyLong_FromVoidPtr(result);