summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-10-17 13:00:31 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-10-18 10:41:59 +0200
commit5055e567de8166137ec2466cdf61a714f81c7be2 (patch)
treec7266f55b0ec0ecbee7ba4e0abb3dd49bc18e603
parentfb050d7799abfd6bda6c21ad78ed5d9d2c92132f (diff)
src: define flowtable device compound as a list
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>
-rw-r--r--src/parser_bison.y2
-rw-r--r--src/parser_json.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 1e2b3001..8ad581f6 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -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
diff --git a/src/parser_json.c b/src/parser_json.c
index bc29dedf..55dbc177 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -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;