X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=libuci.c;h=ada75c04cb2aef36e325d1b3aab86140f95dd4dc;hp=cb0bc360ab442ee1b0cc4617c6b3674d945df212;hb=23a794e9c2e3bf39550e46c0bafe544cf6c617e8;hpb=a1ce94eed364952e8998def4e964ecb6b33b977d diff --git a/libuci.c b/libuci.c index cb0bc36..ada75c0 100644 --- a/libuci.c +++ b/libuci.c @@ -94,6 +94,18 @@ struct uci_context *uci_alloc(void) return ctx; } +void uci_free(struct uci_context *ctx) +{ + struct uci_config *cfg; + + uci_cleanup(ctx); + uci_foreach_entry(config, &ctx->root, cfg) { + uci_drop_config(cfg); + } + free(ctx); + return; +} + int uci_cleanup(struct uci_context *ctx) { UCI_HANDLE_ERR(ctx);