diff options
author | Xiang Zhang <angwerzx@126.com> | 2017-07-18 16:33:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 16:33:29 (GMT) |
commit | 4ed5ad79ec6c6270e6018bd0a55656305ee60907 (patch) | |
tree | ca395563a5d793cd7d269d5c7dfb5611d5710d47 /Modules | |
parent | ba75af713078966cc594fc7f0809ed53c532c58f (diff) | |
download | cpython-4ed5ad79ec6c6270e6018bd0a55656305ee60907.zip cpython-4ed5ad79ec6c6270e6018bd0a55656305ee60907.tar.gz cpython-4ed5ad79ec6c6270e6018bd0a55656305ee60907.tar.bz2 |
bpo-30961: Fix decrementing a borrowed reference in tracemalloc. (#2747)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_tracemalloc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index 00d3542..d983336 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -1752,7 +1752,7 @@ _PyTraceMalloc_Init(void) if (key == NULL) return -1; - value = PyDict_GetItemWithError(xoptions, key); + value = PyDict_GetItemWithError(xoptions, key); /* borrowed */ Py_DECREF(key); if (value == NULL) { if (PyErr_Occurred()) @@ -1763,7 +1763,6 @@ _PyTraceMalloc_Init(void) } nframe = parse_sys_xoptions(value); - Py_DECREF(value); if (nframe < 0) { Py_FatalError("-X tracemalloc=NFRAME: invalid number of frames"); } |