]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44553: Correct failure in tp_new for the union object (GH-27008)
authorPablo Galindo <Pablogsal@gmail.com>
Sat, 3 Jul 2021 20:00:28 +0000 (21:00 +0100)
committerGitHub <noreply@github.com>
Sat, 3 Jul 2021 20:00:28 +0000 (21:00 +0100)
Objects/unionobject.c

index cc7181d2475caf6268075be2a902407d42d55e04..8435763b5ea7ca71f1b447739188e9c71e496cd0 100644 (file)
@@ -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;
 }