From: Felix Fietkau Date: Tue, 20 Jan 2009 00:07:28 +0000 (+0100) Subject: make the uci_ptr struct reusable after a call to uci_delete() X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=00d91c8ca4a5d35d5c3706d0042f0e57cefa3d12;p=uci.git make the uci_ptr struct reusable after a call to uci_delete() --- 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; }