Skip to content

Commit

Permalink
walk: Do not crash on error when evaluating
Browse files Browse the repository at this point in the history
The peeked expression must not be freed on error when
evaluating.

This fixes #120

Signed-off-by: Pantelis Antoniou <[email protected]>
  • Loading branch information
pantoniou committed Sep 30, 2024
1 parent 2bd292c commit 0bbe029
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/fy-walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2973,6 +2973,7 @@ int evaluate_new(struct fy_path_parser *fypp)
goto err_out;

if (!fy_path_expr_type_is_lparen(exprl->type)) {
exprl = NULL;
ret = evaluate_new(fypp);
if (ret)
goto err_out;
Expand All @@ -2996,6 +2997,7 @@ int evaluate_new(struct fy_path_parser *fypp)
if (fy_path_expr_type_is_lparen(exprl->type))
break;

exprl = NULL;
ret = evaluate_new(fypp);
if (ret)
goto err_out;
Expand Down

0 comments on commit 0bbe029

Please sign in to comment.