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)
|
if (m == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (tracemalloc_init() < 0)
|
if (tracemalloc_init() < 0) {
|
||||||
|
Py_DECREF(m);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue