mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
This commit is contained in:
parent
fc6aa28bfd
commit
491bbedc20
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1 @@
|
||||||
|
Fix a leak in set_symmetric_difference().
|
|
@ -1744,8 +1744,10 @@ set_symmetric_difference(PySetObject *so, PyObject *other)
|
||||||
if (otherset == NULL)
|
if (otherset == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
rv = set_symmetric_difference_update(otherset, (PyObject *)so);
|
rv = set_symmetric_difference_update(otherset, (PyObject *)so);
|
||||||
if (rv == NULL)
|
if (rv == NULL) {
|
||||||
|
Py_DECREF(otherset);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
Py_DECREF(rv);
|
Py_DECREF(rv);
|
||||||
return (PyObject *)otherset;
|
return (PyObject *)otherset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue