Skip to content

gh-130050: Fix memory leaks in _testexternalinspection #130051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
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
4 changes: 3 additions & 1 deletion Modules/_testexternalinspection.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ parse_coro_chain(
}

if (PyList_Append(render_to, name)) {
Py_DECREF(name);
return -1;
}
Py_DECREF(name);
Expand Down Expand Up @@ -955,7 +956,6 @@ parse_task(
if (PyList_Append(render_to, result)) {
goto err;
}
Py_DECREF(result);

PyObject *awaited_by = PyList_New(0);
if (awaited_by == NULL) {
Expand All @@ -973,6 +973,7 @@ parse_task(
) {
goto err;
}
Py_DECREF(result);

return 0;

Expand Down Expand Up @@ -1527,6 +1528,7 @@ get_async_stack_trace(PyObject* self, PyObject* args)
}
PyObject* calls = PyList_New(0);
if (calls == NULL) {
Py_DECREF(result);
return NULL;
}
if (PyList_SetItem(result, 0, calls)) { /* steals ref to 'calls' */
Expand Down
Loading