Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-150178: Fix refcount leaks in hamt allocation failure paths (GH-15…
…0179)

(cherry picked from commit 32823af)

Co-authored-by: pengyu lee <lipengyu@kylinos.cn>
  • Loading branch information
lpyu001 authored and miss-islington committed May 23, 2026
commit 56c62672cc29755911de6d397b6753708cac5473
2 changes: 2 additions & 0 deletions Python/hamt.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ hamt_node_bitmap_assoc(PyHamtNode_Bitmap *self,

PyHamtNode_Bitmap *ret = hamt_node_bitmap_clone(self);
if (ret == NULL) {
Py_DECREF(sub_node);
return NULL;
}
Py_SETREF(ret->b_array[val_idx], (PyObject*)sub_node);
Expand Down Expand Up @@ -1010,6 +1011,7 @@ hamt_node_bitmap_without(PyHamtNode_Bitmap *self,

PyHamtNode_Bitmap *clone = hamt_node_bitmap_clone(self);
if (clone == NULL) {
Py_DECREF(sub_node);
return W_ERROR;
}

Expand Down
Loading