Skip to content

Commit aa3efea

Browse files
miss-islingtonZackerySpytz
authored andcommitted
bpo-38532: Add missing decrefs in PyCFuncPtr_FromDll() (GH-17811)
(cherry picked from commit e02ab59) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
1 parent 526f0b3 commit aa3efea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_ctypes/_ctypes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,10 +3554,12 @@ PyCFuncPtr_FromDll(PyTypeObject *type, PyObject *args, PyObject *kwds)
35543554
if (PySys_Audit("ctypes.dlsym",
35553555
((uintptr_t)name & ~0xFFFF) ? "Os" : "On",
35563556
dll, name) < 0) {
3557+
Py_DECREF(ftuple);
35573558
return NULL;
35583559
}
35593560
#else
35603561
if (PySys_Audit("ctypes.dlsym", "Os", dll, name) < 0) {
3562+
Py_DECREF(ftuple);
35613563
return NULL;
35623564
}
35633565
#endif

0 commit comments

Comments
 (0)