]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
ast_expr2: Fix off-nominal memory leak. 66/3166/1
authorRichard Mudgett <rmudgett@digium.com>
Mon, 11 Jul 2016 18:42:55 +0000 (13:42 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 11 Jul 2016 18:47:08 +0000 (13:47 -0500)
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
main/ast_expr2.y

index 781abd95a9c03506064f0017225e78d6b066e3be..a3c715ac1c97bb967f4a98334fdf7ff5cf9f65cf 100644 (file)
@@ -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;
        }
 
index 913bc2662e4c1b35d488bbe1002914f3324803aa..4f60877733b771eca0a4d7b3b9eafb9a0b72e26d 100644 (file)
@@ -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;
        }