summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-07-03 20:51:10 (GMT)
committerGitHub <noreply@github.com>2021-07-03 20:51:10 (GMT)
commit000b9e803a7ec067da0a43f9a3fec16f1078215a (patch)
tree8080183ee2c759d0ef2c2ad3a199fa1c76d135a7 /Objects
parentbea618d780a7b5ce16cd7223983238ee4eeb09c1 (diff)
downloadcpython-000b9e803a7ec067da0a43f9a3fec16f1078215a.zip
cpython-000b9e803a7ec067da0a43f9a3fec16f1078215a.tar.gz
cpython-000b9e803a7ec067da0a43f9a3fec16f1078215a.tar.bz2
bpo-44553: Correct failure in tp_new for the union object (GH-27008) (GH-27009)
(cherry picked from commit bc3961485639cc73de7c4c7eed1b56f3c74939bf) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unionobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unionobject.c b/Objects/unionobject.c
index cc7181d..8435763 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;
}