X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=list.c;h=dee6a14ff9f0d2d2a72c87e4c8890efbf269665e;hp=51fca61fd54f733c6387efe2c6ea28eedde6a301;hb=3f70540dd2f63b866db50a76bbed2e087a276758;hpb=b27715916ec6dd15ee3c1f30976f96fbece0d04e diff --git a/list.c b/list.c index 51fca61..dee6a14 100644 --- a/list.c +++ b/list.c @@ -50,6 +50,7 @@ static void uci_drop_section(struct uci_section *section) { if (!section) return; + /* TODO: drop options */ if (section->name) free(section->name); if (section->type) @@ -83,9 +84,13 @@ error: static void uci_drop_file(struct uci_config *cfg) { - /* TODO: free children */ + struct uci_section *s; + if(!cfg) return; + uci_foreach_entry(section, &cfg->sections, s) { + uci_drop_section(s); + } if (cfg->name) free(cfg->name); free(cfg);