]> pilppa.org Git - uci.git/blobdiff - list.c
more cleanup/list fixes
[uci.git] / list.c
diff --git a/list.c b/list.c
index 51fca61fd54f733c6387efe2c6ea28eedde6a301..dee6a14ff9f0d2d2a72c87e4c8890efbf269665e 100644 (file)
--- 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);