otherset is known to be non-NULL based on checks before and DECREF after.
DECREF otherset rather than XDECREF in error conditions too. Reported by Klockwork #154.
This commit is contained in:
parent
b337bb541b
commit
04e39ec815
|
@ -1380,12 +1380,12 @@ set_symmetric_difference_update(PySetObject *so, PyObject *other)
|
||||||
while (set_next(otherset, &pos, &entry)) {
|
while (set_next(otherset, &pos, &entry)) {
|
||||||
int rv = set_discard_entry(so, entry);
|
int rv = set_discard_entry(so, entry);
|
||||||
if (rv == -1) {
|
if (rv == -1) {
|
||||||
Py_XDECREF(otherset);
|
Py_DECREF(otherset);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (rv == DISCARD_NOTFOUND) {
|
if (rv == DISCARD_NOTFOUND) {
|
||||||
if (set_add_entry(so, entry) == -1) {
|
if (set_add_entry(so, entry) == -1) {
|
||||||
Py_XDECREF(otherset);
|
Py_DECREF(otherset);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue