mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
(cherry picked from commit 4ed5ad79ec
)
This commit is contained in:
parent
8663c45491
commit
241c4a28d9
2 changed files with 2 additions and 2 deletions
|
@ -0,0 +1 @@
|
||||||
|
Fix decrementing a borrowed reference in tracemalloc.
|
|
@ -1731,7 +1731,7 @@ _PyTraceMalloc_Init(void)
|
||||||
if (key == NULL)
|
if (key == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
value = PyDict_GetItemWithError(xoptions, key);
|
value = PyDict_GetItemWithError(xoptions, key); /* borrowed */
|
||||||
Py_DECREF(key);
|
Py_DECREF(key);
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
if (PyErr_Occurred())
|
if (PyErr_Occurred())
|
||||||
|
@ -1742,7 +1742,6 @@ _PyTraceMalloc_Init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
nframe = parse_sys_xoptions(value);
|
nframe = parse_sys_xoptions(value);
|
||||||
Py_DECREF(value);
|
|
||||||
if (nframe < 0) {
|
if (nframe < 0) {
|
||||||
Py_FatalError("-X tracemalloc=NFRAME: invalid number of frames");
|
Py_FatalError("-X tracemalloc=NFRAME: invalid number of frames");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue