From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Tue, 8 Nov 2022 06:50:07 +0000 (+0530) Subject: GH-90699: fix refleak in `_testcapimodule.c` (gh-99236) X-Git-Tag: v3.12.0a2~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a751bf565c731c87f2e02678ee080f04c86d7eee;p=thirdparty%2FPython%2Fcpython.git GH-90699: fix refleak in `_testcapimodule.c` (gh-99236) --- diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 0e09c97bea09..1624a93ec3f3 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -3375,6 +3375,7 @@ slot_tp_del(PyObject *self) } /* Execute __del__ method, if any. */ del = _PyType_Lookup(Py_TYPE(self), tp_del); + Py_DECREF(tp_del); if (del != NULL) { res = PyObject_CallOneArg(del, self); if (res == NULL)