]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-100997: fix refleak in `_testinternalcapi.c` (#101058)
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Mon, 16 Jan 2023 10:41:57 +0000 (16:11 +0530)
committerGitHub <noreply@github.com>
Mon, 16 Jan 2023 10:41:57 +0000 (16:11 +0530)
Modules/_testinternalcapi.c

index f53929f80f8adf73b5655c274d299646d4690e27..ba57719d92096bc54360167229ebc5e51f8270fd 100644 (file)
@@ -566,6 +566,7 @@ record_eval(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc)
         PyObject *module = _get_current_module();
         assert(module != NULL);
         module_state *state = get_module_state(module);
+        Py_DECREF(module);
         PyList_Append(state->record_list, ((PyFunctionObject *)f->f_funcobj)->func_name);
     }
     return _PyEval_EvalFrameDefault(tstate, f, exc);