From: Richard Mudgett Date: Mon, 11 Jul 2016 18:42:55 +0000 (-0500) Subject: ast_expr2: Fix off-nominal memory leak. X-Git-Tag: 14.0.0-beta1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44f16af7cc9a6bc5203106a81b595997cb31c4fd;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/ast_expr2.c b/main/ast_expr2.c index b914598ec8..215f8312fd 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 29fee35cf6..8b32b2b9c0 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; }