mirror of
https://github.com/python/cpython.git
synced 2026-04-13 23:31:02 +00:00
gh-145376: Fix refleaks and double decref for code in Python/ (#145666)
This commit is contained in:
parent
19676e5fc2
commit
3f7141dac9
3 changed files with 6 additions and 5 deletions
|
|
@ -2243,6 +2243,7 @@ _PyEval_ExceptionGroupMatch(_PyInterpreterFrame *frame, PyObject* exc_value,
|
|||
if (f != NULL) {
|
||||
PyObject *tb = _PyTraceBack_FromFrame(NULL, f);
|
||||
if (tb == NULL) {
|
||||
Py_DECREF(wrapped);
|
||||
return -1;
|
||||
}
|
||||
PyException_SetTraceback(wrapped, tb);
|
||||
|
|
|
|||
|
|
@ -1103,12 +1103,12 @@ _convert_exc_to_TracebackException(PyObject *exc, PyObject **p_tbexc)
|
|||
}
|
||||
|
||||
PyObject *tbexc = PyObject_Call(create, args, kwargs);
|
||||
Py_DECREF(args);
|
||||
Py_DECREF(kwargs);
|
||||
Py_DECREF(create);
|
||||
if (tbexc == NULL) {
|
||||
goto error;
|
||||
}
|
||||
Py_DECREF(args);
|
||||
Py_DECREF(kwargs);
|
||||
Py_DECREF(create);
|
||||
|
||||
*p_tbexc = tbexc;
|
||||
return 0;
|
||||
|
|
@ -1497,7 +1497,7 @@ _PyXI_excinfo_Apply(_PyXI_excinfo *info, PyObject *exctype)
|
|||
|
||||
PyObject *formatted = _PyXI_excinfo_format(info);
|
||||
PyErr_SetObject(exctype, formatted);
|
||||
Py_DECREF(formatted);
|
||||
Py_XDECREF(formatted);
|
||||
|
||||
if (tbexc != NULL) {
|
||||
PyObject *exc = PyErr_GetRaisedException();
|
||||
|
|
|
|||
|
|
@ -2499,7 +2499,7 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
|
|||
}
|
||||
|
||||
if (PySys_Audit("sys.remote_exec", "iO", pid, script) < 0) {
|
||||
return NULL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
debugger_script_path = PyBytes_AS_STRING(path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue