bpo-32436: Fix potential NULL dereference (#5286)

diff --git a/Python/hamt.c b/Python/hamt.c
index eb69fdd..af3dfce 100644
--- a/Python/hamt.c
+++ b/Python/hamt.c
@@ -1055,6 +1055,10 @@
 #endif
 
                 PyHamtNode_Bitmap *clone = hamt_node_bitmap_clone(self);
+                if (clone == NULL) {
+                    return W_ERROR;
+                }
+
                 Py_SETREF(clone->b_array[val_idx],
                           (PyObject *)sub_node);  /* borrow */