]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: define flowtable device compound as a list
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 17 Oct 2019 11:00:31 +0000 (13:00 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 18 Oct 2019 08:41:59 +0000 (10:41 +0200)
This fixes a memleak when releasing the compound expression via
expr_free().

Fixes: 92911b362e90 ("src: add support to add flowtables")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/parser_bison.y
src/parser_json.c

index 1e2b30015f78193b4fc781f42121bb57b9f9a040..8ad581f69271b8071e58f5f3d129701362897243 100644 (file)
@@ -1826,7 +1826,7 @@ flowtable_expr            :       '{'     flowtable_list_expr     '}'
 
 flowtable_list_expr    :       flowtable_expr_member
                        {
-                               $$ = compound_expr_alloc(&@$, EXPR_INVALID);
+                               $$ = compound_expr_alloc(&@$, EXPR_LIST);
                                compound_expr_add($$, $1);
                        }
                        |       flowtable_list_expr     COMMA   flowtable_expr_member
index bc29dedf5b4c3c523d2b56d3fc241e1af0aaa5d7..55dbc177cc98ddf6cac6a18f653dc396115e4b23 100644 (file)
@@ -2914,7 +2914,7 @@ static struct cmd *json_parse_cmd_add_element(struct json_ctx *ctx,
 static struct expr *json_parse_flowtable_devs(struct json_ctx *ctx,
                                              json_t *root)
 {
-       struct expr *tmp, *expr = compound_expr_alloc(int_loc, EXPR_INVALID);
+       struct expr *tmp, *expr = compound_expr_alloc(int_loc, EXPR_LIST);
        const char *dev;
        json_t *value;
        size_t index;