summaryrefslogtreecommitdiff
path: root/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'list.c')
-rw-r--r--list.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/list.c b/list.c
index cd6d305..9486ffb 100644
--- a/list.c
+++ b/list.c
@@ -567,6 +567,12 @@ int uci_delete(struct uci_context *ctx, struct uci_ptr *ptr)
uci_add_history(ctx, &p->history, UCI_CMD_REMOVE, ptr->section, ptr->option, NULL);
uci_free_any(&e);
+
+ if (ptr->option)
+ ptr->o = NULL;
+ else if (ptr->section)
+ ptr->s = NULL;
+
return 0;
}