Index: src/conf.c =================================================================== --- src/conf.c (revision 3757) +++ src/conf.c (revision 3758) @@ -1144,10 +1144,13 @@ lht_node_t *old = lht_tree_list_nth(cwd, idx); if (old != NULL) { /* the list is large enough already: overwrite the element at idx */ - if (new_val != NULL) + if (new_val == NULL) { + err = lht_tree_del(old); + free(path); + return 0; + } + else err = lht_tree_list_replace_child(cwd, old, nn); - else - err = lht_tree_del(old); } else if (new_val == NULL) { free(path);