mirror of
https://github.com/python/cpython.git
synced 2026-06-04 16:50:51 +00:00
gh-150379: fix ref leak in C API monitoring events (#150381)
This commit is contained in:
parent
832afeddce
commit
71cf3130c6
1 changed files with 3 additions and 1 deletions
|
|
@ -2630,8 +2630,9 @@ capi_call_instrumentation(PyMonitoringState *state, PyObject *codelike, int32_t
|
|||
PyErr_SetString(PyExc_ValueError, "offset must be non-negative");
|
||||
return -1;
|
||||
}
|
||||
PyObject *offset_obj = NULL;
|
||||
if (event != PY_MONITORING_EVENT_LINE) {
|
||||
PyObject *offset_obj = PyLong_FromLong(offset);
|
||||
offset_obj = PyLong_FromLong(offset);
|
||||
if (offset_obj == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -2672,6 +2673,7 @@ capi_call_instrumentation(PyMonitoringState *state, PyObject *codelike, int32_t
|
|||
}
|
||||
}
|
||||
}
|
||||
Py_XDECREF(offset_obj);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue