]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-132781: fix refleaks in `crossinterp_exceptions.h` post gh-132782 (#132989)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sat, 26 Apr 2025 10:14:14 +0000 (12:14 +0200)
committerGitHub <noreply@github.com>
Sat, 26 Apr 2025 10:14:14 +0000 (12:14 +0200)
Python/crossinterp_exceptions.h

index 857c4d1e379a0eeb4d86f82177bc398018b7de46..ca4ca1cf123e494d4368b4219f575a5afd70ee0c 100644 (file)
@@ -110,6 +110,7 @@ set_notshareableerror(PyThreadState *tstate, PyObject *cause, int force, const c
     }
     else {
         _ensure_notshareableerror(tstate, cause, force, msgobj);
+        Py_DECREF(msgobj);
     }
 }
 
@@ -123,6 +124,7 @@ format_notshareableerror_v(PyThreadState *tstate, PyObject *cause, int force,
     }
     else {
         _ensure_notshareableerror(tstate, cause, force, msgobj);
+        Py_DECREF(msgobj);
     }
 }