--- a/src/kv_list.c Sat Sep 20 12:19:49 2025 +0200 +++ b/src/kv_list.c Sat Sep 20 12:27:36 2025 +0200 @@ -470,8 +470,13 @@ cx_hash_murmur(&key); } - // add the key to the map - // TODO: what happens when we are _replacing_ an existing key? + // check if the key is already assigned + if (kv_list->map_methods->get(&kv_list->map->map_base.base, key) != NULL) { + // key is already assigned, we disallow re-assignment + return 1; + } + + // add the key to the map; if (NULL == kv_list->map_methods->put(&kv_list->map->map_base.base, key, node_data)) { return 1; }