Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
For refleaks and double decref for code in Python/
  • Loading branch information
eendebakpt committed Mar 9, 2026
commit d245ccbdfebe4521199cd70b4e0f8b93bfc64c13
1 change: 1 addition & 0 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions Python/crossinterp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,7 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
}

if (PySys_Audit("sys.remote_exec", "iO", pid, script) < 0) {
Py_DECREF(path);
return NULL;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may reuse goto error; here.

}

Expand Down
Loading