From: Pablo Galindo Date: Sat, 3 Jul 2021 20:00:28 +0000 (+0100) Subject: bpo-44553: Correct failure in tp_new for the union object (GH-27008) X-Git-Tag: v3.11.0a1~737 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc3961485639cc73de7c4c7eed1b56f3c74939bf;p=thirdparty%2FPython%2Fcpython.git bpo-44553: Correct failure in tp_new for the union object (GH-27008) --- diff --git a/Objects/unionobject.c b/Objects/unionobject.c index cc7181d2475c..8435763b5ea7 100644 --- a/Objects/unionobject.c +++ b/Objects/unionobject.c @@ -490,10 +490,10 @@ _Py_Union(PyObject *args) } result->args = dedup_and_flatten_args(args); + _PyObject_GC_TRACK(result); if (result->args == NULL) { - PyObject_GC_Del(result); + Py_DECREF(result); return NULL; } - _PyObject_GC_TRACK(result); return (PyObject*)result; }