From: Pieter Eendebak Date: Wed, 4 Mar 2026 13:34:24 +0000 (+0100) Subject: gh-145376: Fix refleak in unusual error path in BaseExceptionGroup_new (GH-145474) X-Git-Tag: v3.15.0a7~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18aec59fe5bbae9225951ca4d69bfca17eba82d8;p=thirdparty%2FPython%2Fcpython.git gh-145376: Fix refleak in unusual error path in BaseExceptionGroup_new (GH-145474) --- diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 499fb2b34b34..f5edc286243e 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -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 */