free memory for uci hooks
authorFelix Fietkau <nbd@openwrt.org>
Fri, 23 Sep 2011 13:12:47 +0000 (07:12 -0600)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 21 Oct 2011 13:17:06 +0000 (15:17 +0200)
libuci.c

index c6d9992bb78f3d9ebd79e70ebd393d52d5720764..995d39dad7fdf952eec0aa49b6af92cfcb5ff8cc 100644 (file)
--- a/libuci.c
+++ b/libuci.c
@@ -325,6 +325,7 @@ int uci_remove_hook(struct uci_context *ctx, const struct uci_hook_ops *ops)
                struct uci_hook *h = uci_to_hook(e);
                if (h->ops == ops) {
                        uci_list_del(&e->list);
                struct uci_hook *h = uci_to_hook(e);
                if (h->ops == ops) {
                        uci_list_del(&e->list);
+                       uci_free_element(e);
                        return 0;
                }
        }
                        return 0;
                }
        }