diff options
| author | Brandt Bucher <brandtbucher@gmail.com> | 2019-11-20 02:00:31 -0800 |
|---|---|---|
| committer | Victor Stinner <vstinner@python.org> | 2019-11-20 11:00:31 +0100 |
| commit | d51a363a4379385fdfe9c09a56324631465ede29 (patch) | |
| tree | 227698e0b2cdecbbc0d9d4b87301c9e872657c6b /Modules | |
| parent | 7eee5beaf87be898a679278c480e8dd0df76d351 (diff) | |
| download | cpython-git-d51a363a4379385fdfe9c09a56324631465ede29.tar.gz | |
bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)
Diffstat (limited to 'Modules')
| -rw-r--r-- | Modules/_tracemalloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index 211c6fbb8b..70219721b5 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; } |
