gh-145376: Fix refleak in unusual error path in BaseExceptionGroup_ne… · python/cpython@18aec59

GitHub

Original file line numberDiff line numberDiff line change@@ -912,7 +912,7 @@ BaseExceptionGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwds)

912912913913exceptions=PySequence_Tuple(exceptions);

914914if (!exceptions) {

915-returnNULL;

915+goto error;

916916 }

917917918918/* We are now holding a ref to the exceptions tuple */