Skip to content

Commit d51a363

Browse files
brandtbuchervstinner
authored andcommitted
bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)
1 parent 7eee5be commit d51a363

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/_tracemalloc.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1656,8 +1656,10 @@ PyInit__tracemalloc(void)
16561656
if (m == NULL)
16571657
return NULL;
16581658

1659-
if (tracemalloc_init() < 0)
1659+
if (tracemalloc_init() < 0) {
1660+
Py_DECREF(m);
16601661
return NULL;
1662+
}
16611663

16621664
return m;
16631665
}

0 commit comments

Comments
 (0)