commit | e02ab59fdffa0bb841182c30ef1355c89578d945 | [log] [tgz] |
---|---|---|
author | Zackery Spytz <zspytz@gmail.com> | Fri Jan 03 05:16:12 2020 -0700 |
committer | T. Wouters <thomas@python.org> | Fri Jan 03 13:16:12 2020 +0100 |
tree | ae0d364c36c9ed3e4b6e5e7d3d78ddfdc0dac946 | |
parent | b789202cbedd93898c29b08a44ca085bf0723d81 [diff] |
bpo-38532: Add missing decrefs in PyCFuncPtr_FromDll() (GH-16857)
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 @@ 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