From: Pablo Galindo Salgado Date: Tue, 20 May 2025 23:54:09 +0000 (-0400) Subject: gh-91048: Fix error path result in _remote_debugging_module (#134347) X-Git-Tag: v3.15.0a1~1611 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d327159eb4dd286973d10af93999de90a860880a;p=thirdparty%2FPython%2Fcpython.git gh-91048: Fix error path result in _remote_debugging_module (#134347) --- diff --git a/Modules/_remote_debugging_module.c b/Modules/_remote_debugging_module.c index 42db93bb5ead..8c0f40f835c3 100644 --- a/Modules/_remote_debugging_module.c +++ b/Modules/_remote_debugging_module.c @@ -1556,7 +1556,7 @@ get_stack_trace(PyObject* self, PyObject* args) &address_of_current_frame) < 0) { - Py_DECREF(result); + Py_CLEAR(result); goto result_err; } @@ -1565,7 +1565,7 @@ get_stack_trace(PyObject* self, PyObject* args) } if (PyList_Append(result, frame_info) == -1) { - Py_DECREF(result); + Py_CLEAR(result); goto result_err; }