summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2020-01-03 12:16:12 (GMT)
committerT. Wouters <thomas@python.org>2020-01-03 12:16:12 (GMT)
commite02ab59fdffa0bb841182c30ef1355c89578d945 (patch)
treeae0d364c36c9ed3e4b6e5e7d3d78ddfdc0dac946 /Modules/_ctypes
parentb789202cbedd93898c29b08a44ca085bf0723d81 (diff)
downloadcpython-e02ab59fdffa0bb841182c30ef1355c89578d945.zip
cpython-e02ab59fdffa0bb841182c30ef1355c89578d945.tar.gz
cpython-e02ab59fdffa0bb841182c30ef1355c89578d945.tar.bz2
bpo-38532: Add missing decrefs in PyCFuncPtr_FromDll() (GH-16857)
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r--Modules/_ctypes/_ctypes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index d38d892..93af497 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