diff options
-rw-r--r-- | main/ast_expr2.c | 2 | ||||
-rw-r--r-- | main/ast_expr2.y | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c index b914598ec..215f8312f 100644 --- a/main/ast_expr2.c +++ b/main/ast_expr2.c @@ -3673,6 +3673,8 @@ op_tildetilde (struct val *a, struct val *b) vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1); if (vs == NULL) { ast_log(LOG_WARNING, "malloc() failed\n"); + free_value(a); + free_value(b); return NULL; } diff --git a/main/ast_expr2.y b/main/ast_expr2.y index 29fee35cf..8b32b2b9c 100644 --- a/main/ast_expr2.y +++ b/main/ast_expr2.y @@ -1666,6 +1666,8 @@ op_tildetilde (struct val *a, struct val *b) vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1); if (vs == NULL) { ast_log(LOG_WARNING, "malloc() failed\n"); + free_value(a); + free_value(b); return NULL; } |