diff options
author | Zackery Spytz <zspytz@gmail.com> | 2020-01-03 12:16:12 (GMT) |
---|---|---|
committer | T. Wouters <thomas@python.org> | 2020-01-03 12:16:12 (GMT) |
commit | e02ab59fdffa0bb841182c30ef1355c89578d945 (patch) | |
tree | ae0d364c36c9ed3e4b6e5e7d3d78ddfdc0dac946 /Modules | |
parent | b789202cbedd93898c29b08a44ca085bf0723d81 (diff) | |
download | cpython-e02ab59fdffa0bb841182c30ef1355c89578d945.zip cpython-e02ab59fdffa0bb841182c30ef1355c89578d945.tar.gz cpython-e02ab59fdffa0bb841182c30ef1355c89578d945.tar.bz2 |
bpo-38532: Add missing decrefs in PyCFuncPtr_FromDll() (GH-16857)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 2 |
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 |