diff options
author | Richard Mudgett <rmudgett@digium.com> | 2016-07-11 13:42:55 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-07-11 13:51:17 -0500 |
commit | 5ee205d8bb0dfbae5be89661aa3a787fbdf9986b (patch) | |
tree | 2a203ac20b2ab1ed37049fb30879c738ef604edc | |
parent | 8019f321290818de8be4772c8b6afaa6e9b312b2 (diff) |
ast_expr2: Fix off-nominal memory leak.
Thanks to ibercom for pointing out a memory leak that was missed
in the earlier patch for the issue.
ASTERISK-26119
Reported by: Alexei Gradinari
Change-Id: I9a151f5c4725d97fb82a9e938bc73dc659532b71
-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 781abd95a..a3c715ac1 100644 --- a/main/ast_expr2.c +++ b/main/ast_expr2.c @@ -3672,6 +3672,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 913bc2662..4f6087773 100644 --- a/main/ast_expr2.y +++ b/main/ast_expr2.y @@ -1665,6 +1665,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; } |