X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=list.c;h=88f07bd05c07e9ebbfe6c3a5a42f31e724be71c2;hb=3a31f869e08a9f11f2e2e962257b98dc1e028cb7;hp=bd70857abdb1af2bc5e71748d327f95099e30bf9;hpb=52d873161248b1160596ee8ca91b2e6fd315fc18;p=project%2Fuci.git diff --git a/list.c b/list.c index bd70857..88f07bd 100644 --- a/list.c +++ b/list.c @@ -173,7 +173,7 @@ uci_free_package(struct uci_package *p) } /* record a change that was done to a package */ -static inline void +static void uci_add_history(struct uci_context *ctx, struct uci_package *p, int cmd, char *section, char *option, char *value) { struct uci_history *h; @@ -197,6 +197,19 @@ uci_add_history(struct uci_context *ctx, struct uci_package *p, int cmd, char *s uci_list_add(&p->history, &h->e.list); } +static void +uci_free_history(struct uci_history *h) +{ + if (!h) + return; + if ((h->section != NULL) && + (h->section != uci_dataptr(h))) { + free(h->section); + free(h->value); + } + uci_free_element(&h->e); +} + static struct uci_element *uci_lookup_list(struct uci_context *ctx, struct uci_list *list, const char *name) { struct uci_element *e;