]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91048: Fix error path result in _remote_debugging_module (#134347)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Tue, 20 May 2025 23:54:09 +0000 (19:54 -0400)
committerGitHub <noreply@github.com>
Tue, 20 May 2025 23:54:09 +0000 (19:54 -0400)
Modules/_remote_debugging_module.c

index 42db93bb5ead0f56a87d2afbba163b188f74d68d..8c0f40f835c36e4a55ffc5badcf2f7840e6d5fde 100644 (file)
@@ -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;
         }