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

This commit is contained in:
Zackery Spytz 2020-01-03 05:16:12 -07:00 committed by T. Wouters
parent b789202cbe
commit e02ab59fdf

View file

@ -3554,10 +3554,12 @@ PyCFuncPtr_FromDll(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (PySys_Audit("ctypes.dlsym", if (PySys_Audit("ctypes.dlsym",
((uintptr_t)name & ~0xFFFF) ? "Os" : "On", ((uintptr_t)name & ~0xFFFF) ? "Os" : "On",
dll, name) < 0) { dll, name) < 0) {
Py_DECREF(ftuple);
return NULL; return NULL;
} }
#else #else
if (PySys_Audit("ctypes.dlsym", "Os", dll, name) < 0) { if (PySys_Audit("ctypes.dlsym", "Os", dll, name) < 0) {
Py_DECREF(ftuple);
return NULL; return NULL;
} }
#endif #endif