Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)
(cherry picked from commit d51a363)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
  • Loading branch information
brandtbucher authored and miss-islington committed Nov 20, 2019
commit 27b96c617d7d8f5e07e10254fc0d1e11d95c8632
4 changes: 3 additions & 1 deletion Modules/_tracemalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down