aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlekma <lekmalek@gmail.com>2018-05-02 11:29:10 +0200
committerINADA Naoki <methane@users.noreply.github.com>2018-05-02 18:29:10 +0900
commit491bbedc209fea314a04cb3015da68fb0aa63238 (patch)
treeb5914373e115eea5b7581a5c715bb2404fe26c1b /Objects/setobject.c
parentMitigate macOS race condition in installer build (GH-6686) (diff)
downloadcpython-491bbedc209fea314a04cb3015da68fb0aa63238.tar.gz
cpython-491bbedc209fea314a04cb3015da68fb0aa63238.tar.bz2
cpython-491bbedc209fea314a04cb3015da68fb0aa63238.zip
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r--Objects/setobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 80101dda9be..82b58382081 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1744,8 +1744,10 @@ set_symmetric_difference(PySetObject *so, PyObject *other)
if (otherset == NULL)
return NULL;
rv = set_symmetric_difference_update(otherset, (PyObject *)so);
- if (rv == NULL)
+ if (rv == NULL) {
+ Py_DECREF(otherset);
return NULL;
+ }
Py_DECREF(rv);
return (PyObject *)otherset;
}