bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)
(cherry picked from commit d51a363a43
)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
This commit is contained in:
parent
2ea4c37c1e
commit
daf7a082b2
|
@ -1637,8 +1637,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