From a751bf565c731c87f2e02678ee080f04c86d7eee Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:20:07 +0530 Subject: [PATCH] GH-90699: fix refleak in `_testcapimodule.c` (gh-99236) --- Modules/_testcapimodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 0e09c97bea0..1624a93ec3f 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)