Skip to content

Commit

Permalink
bpo-33391: Fix refleak in set_symmetric_difference (pythonGH-6670)
Browse files Browse the repository at this point in the history
(cherry picked from commit 491bbed)

Co-authored-by: lekma <lekmalek@gmail.com>
  • Loading branch information
lekma authored and miss-islington committed May 2, 2018
1 parent 5818f08 commit d2e709e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
@@ -0,0 +1 @@
Fix a leak in set_symmetric_difference().
4 changes: 3 additions & 1 deletion Objects/setobject.c
Expand Up @@ -1710,8 +1710,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;
}
Expand Down

0 comments on commit d2e709e

Please sign in to comment.