summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/_tracemalloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index 211c6fb..7021972 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -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;
}