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 <[email protected]>
---
src/parser_bison.y | 2 +-
src/parser_json.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 1e2b30015f78..8ad581f69271 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 bc29dedf5b4c..55dbc177cc98 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;
--
2.11.0