summaryrefslogtreecommitdiff
path: root/list.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-01-20 01:07:28 +0100
committerFelix Fietkau <nbd@openwrt.org>2009-01-20 01:07:28 +0100
commit00d91c8ca4a5d35d5c3706d0042f0e57cefa3d12 (patch)
tree181d6d874f2cdd3f8f2123b94a3617ecae60a1ad /list.c
parent9d0c6014304f1dd2f1f7a57e2039520b0f330250 (diff)
downloaduci-00d91c8ca4a5d35d5c3706d0042f0e57cefa3d12.tar.gz
make the uci_ptr struct reusable after a call to uci_delete()
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;
}