[Python-checkins] bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
Miss Islington (bot)
webhook-mailer at python.org
Wed May 2 06:12:23 EDT 2018
https://github.com/python/cpython/commit/d5546991a2123b6ec84f7c4ecf37b62bedd78ea4
commit: d5546991a2123b6ec84f7c4ecf37b62bedd78ea4
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-05-02T03:12:18-07:00
summary:
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
(cherry picked from commit 491bbedc209fea314a04cb3015da68fb0aa63238)
Co-authored-by: lekma <lekmalek at gmail.com>
files:
A Misc/NEWS.d/next/Core and Builtins/2018-05-02-08-36-03.bpo-33391.z4a7rb.rst
M Objects/setobject.c
diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-05-02-08-36-03.bpo-33391.z4a7rb.rst b/Misc/NEWS.d/next/Core and Builtins/2018-05-02-08-36-03.bpo-33391.z4a7rb.rst
new file mode 100644
index 000000000000..ab17aa408c06
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2018-05-02-08-36-03.bpo-33391.z4a7rb.rst
@@ -0,0 +1 @@
+Fix a leak in set_symmetric_difference().
diff --git a/Objects/setobject.c b/Objects/setobject.c
index c742041b16de..96485f83ecb6 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1740,8 +1740,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;
}
More information about the Python-checkins
mailing list