Skip to content

Commit 997148b

Browse files
committed
Fix refleak in the test
1 parent ecfa30b commit 997148b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_testcapimodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,6 +3469,7 @@ tracemalloc_track_race(PyObject *self, PyObject *args)
34693469
if (res == NULL) {
34703470
goto error;
34713471
}
3472+
Py_DECREF(res);
34723473

34733474
stop = PyObject_GetAttrString(tracemalloc, "stop");
34743475
Py_CLEAR(tracemalloc);
@@ -3501,6 +3502,7 @@ tracemalloc_track_race(PyObject *self, PyObject *args)
35013502
if (res == NULL) {
35023503
goto error;
35033504
}
3505+
Py_DECREF(res);
35043506

35053507
// Wait until threads complete with the GIL released
35063508
Py_BEGIN_ALLOW_THREADS

0 commit comments

Comments
 (0)