X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=list.c;h=9486ffba17d1f9b871d3709921fb8e499bfd9dfe;hp=cd6d30522941f4d0411293d3a1e3c2f127dd57e7;hb=00d91c8ca4a5d35d5c3706d0042f0e57cefa3d12;hpb=9d0c6014304f1dd2f1f7a57e2039520b0f330250;ds=sidebyside 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; }