From 0bc1206299e0be15aedd38f50421b439dc1f14f4 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 11 Jul 2016 13:42:55 -0500 Subject: [PATCH] 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 --- main/ast_expr2.c | 2 ++ main/ast_expr2.y | 2 ++ 2 files changed, 4 insertions(+) diff --git a/main/ast_expr2.c b/main/ast_expr2.c index 781abd95a9..a3c715ac1c 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 913bc2662e..4f60877733 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; } -- 2.47.2