Skip to content

Commit 36d7afc

Browse files
Fix memory leaks
1 parent 0fc920f commit 36d7afc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Objects/dictobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6641,6 +6641,8 @@ dictitems_xor_lock_held(PyObject *d1, PyObject *d2)
66416641
if (_PyDict_DelItem_KnownHash(temp_dict, key, hash) < 0) {
66426642
goto error;
66436643
}
6644+
Py_DECREF(key);
6645+
Py_DECREF(val2);
66446646
}
66456647
else {
66466648
PyObject *pair = _PyTuple_FromPairSteal(key, val2);
@@ -6654,6 +6656,7 @@ dictitems_xor_lock_held(PyObject *d1, PyObject *d2)
66546656
}
66556657
Py_DECREF(pair);
66566658
}
6659+
Py_XDECREF(val1);
66576660
}
66586661
key = val1 = val2 = NULL;
66596662

0 commit comments

Comments
 (0)