]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-145376: Fix refleak in unusual error path in BaseExceptionGroup_new (GH-145474)
authorPieter Eendebak <pieter.eendebak@gmail.com>
Wed, 4 Mar 2026 13:34:24 +0000 (14:34 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Mar 2026 13:34:24 +0000 (14:34 +0100)
Objects/exceptions.c

index 499fb2b34b34a894536ff72cdd284630c70a7b51..f5edc286243ee12293d0a7765b1a3c820a1e22d2 100644 (file)
@@ -912,7 +912,7 @@ BaseExceptionGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 
     exceptions = PySequence_Tuple(exceptions);
     if (!exceptions) {
-        return NULL;
+        goto error;
     }
 
     /* We are now holding a ref to the exceptions tuple */