]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-119431: fix refleak in test_monitoring (#119444)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Thu, 23 May 2024 09:21:53 +0000 (05:21 -0400)
committerGitHub <noreply@github.com>
Thu, 23 May 2024 09:21:53 +0000 (10:21 +0100)
Python/instrumentation.c

index 3d78214738e66b86a261d0136b494d08386ff4bd..9095fb981b798166e6115076774fbdced1eb3d76 100644 (file)
@@ -2724,5 +2724,6 @@ _PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelik
     }
     PyObject *args[4] = { NULL, NULL, NULL, exc };
     int err = capi_call_instrumentation(state, codelike, offset, args, 3, event);
+    Py_DECREF(exc);
     return exception_event_teardown(err, NULL);
 }