diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-07-28 19:39:12 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-07-29 23:40:58 +0200 |
commit | 1b5fdcbb3564fdb52cc11dedbb446701f3ce53e6 (patch) | |
tree | 6a3c894bc302965b794d6184e81a2b8af2f55539 /src | |
parent | a2fb19736bf6879146dba5cd40a3265cb1c9671b (diff) |
evaluate: memleak in invalid default policy definition
Release the clone expression from the exit path.
Fixes: 5173151863d3 ("evaluate: replace variable expression by the value expression")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/evaluate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/evaluate.c b/src/evaluate.c index a84e9609..a9822ebc 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -2017,8 +2017,10 @@ static int expr_evaluate_variable(struct eval_ctx *ctx, struct expr **exprp) { struct expr *new = expr_clone((*exprp)->sym->expr); - if (expr_evaluate(ctx, &new) < 0) + if (expr_evaluate(ctx, &new) < 0) { + expr_free(new); return -1; + } expr_free(*exprp); *exprp = new; |