[Python-checkins] bpo-38532: Add missing decrefs in PyCFuncPtr_FromDll() (GH-16857)

T. Wouters webhook-mailer at python.org
Fri Jan 3 07:16:16 EST 2020


https://github.com/python/cpython/commit/e02ab59fdffa0bb841182c30ef1355c89578d945
commit: e02ab59fdffa0bb841182c30ef1355c89578d945
branch: master
author: Zackery Spytz <zspytz at gmail.com>
committer: T. Wouters <thomas at python.org>
date: 2020-01-03T13:16:12+01:00
summary:

bpo-38532: Add missing decrefs in PyCFuncPtr_FromDll() (GH-16857)

files:
M Modules/_ctypes/_ctypes.c

diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index d38d892be621c..93af497bda25f 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -3554,10 +3554,12 @@ PyCFuncPtr_FromDll(PyTypeObject *type, PyObject *args, PyObject *kwds)
     if (PySys_Audit("ctypes.dlsym",
                     ((uintptr_t)name & ~0xFFFF) ? "Os" : "On",
                     dll, name) < 0) {
+        Py_DECREF(ftuple);
         return NULL;
     }
 #else
     if (PySys_Audit("ctypes.dlsym", "Os", dll, name) < 0) {
+        Py_DECREF(ftuple);
         return NULL;
     }
 #endif



More information about the Python-checkins mailing list