]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[2.7] bpo-13096: Fix memory leak in ctypes POINTER handling of large values (GH-12100)
authorstratakis <cstratak@redhat.com>
Mon, 4 Mar 2019 15:40:25 +0000 (16:40 +0100)
committerVictor Stinner <vstinner@redhat.com>
Mon, 4 Mar 2019 15:40:25 +0000 (16:40 +0100)
Misc/NEWS.d/next/Library/2019-03-04-16-13-01.bpo-13096.SGPt_n.rst [new file with mode: 0644]
Modules/_ctypes/callproc.c

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 (file)
index 0000000..2bf49c8
--- /dev/null
@@ -0,0 +1 @@
+Fix memory leak in ctypes POINTER handling of large values.
index 2097342085788ecf7af988ea007e4e6d9ac26b6b..defcde1ff3e965486c8861ab6eb204fcacce5894 100644 (file)
@@ -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);