Commit 4ed5ad79 authored by Xiang Zhang's avatar Xiang Zhang Committed by GitHub

bpo-30961: Fix decrementing a borrowed reference in tracemalloc. (#2747)

parent ba75af71
Fix decrementing a borrowed reference in tracemalloc.
......@@ -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");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment