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

This commit is contained in:
Pablo Galindo 2021-07-03 21:00:28 +01:00 committed by GitHub
parent d968a638fc
commit bc39614856
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;
}