more config functions
[project/uci.git] / parse.c
diff --git a/parse.c b/parse.c
index f5e6c29..9dd7126 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -72,8 +72,10 @@ static void uci_parse_cleanup(struct uci_context *ctx)
        if (!pctx)
                return;
 
-       if (pctx->cfg)
+       if (pctx->cfg) {
+               uci_list_del(&pctx->cfg->list);
                uci_drop_file(pctx->cfg);
+       }
        if (pctx->buf)
                free(pctx->buf);
        if (pctx->file)
@@ -161,12 +163,16 @@ static char *next_arg(struct uci_context *ctx, char **str, bool required)
        switch (**str) {
                case '"':
                        val = parse_double_quote(str);
+                       break;
                case '\'':
                        val = parse_single_quote(str);
+                       break;
                case 0:
                        val = NULL;
+                       break;
                default:
                        val = parse_unquoted(str);
+                       break;
        }
 
        if (required && !val) {