bpo-44553: Correct failure in tp_new for the union object (GH-27008) (GH-27009)

(cherry picked from commit bc39614856)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-07-03 13:51:10 -07:00 committed by GitHub
parent bea618d780
commit 000b9e803a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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;
}