bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)
This commit is contained in:
parent
7eee5beaf8
commit
d51a363a43
|
@ -1656,8 +1656,10 @@ PyInit__tracemalloc(void)
|
|||
if (m == NULL)
|
||||
return NULL;
|
||||
|
||||
if (tracemalloc_init() < 0)
|
||||
if (tracemalloc_init() < 0) {
|
||||
Py_DECREF(m);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue