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
This commit is contained in:
Richard Mudgett
2016-07-11 13:42:55 -05:00
parent 8019f32129
commit 5ee205d8bb
2 changed files with 4 additions and 0 deletions

View File

@@ -3672,6 +3672,8 @@ op_tildetilde (struct val *a, struct val *b)
vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1); vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1);
if (vs == NULL) { if (vs == NULL) {
ast_log(LOG_WARNING, "malloc() failed\n"); ast_log(LOG_WARNING, "malloc() failed\n");
free_value(a);
free_value(b);
return NULL; return NULL;
} }

View File

@@ -1665,6 +1665,8 @@ op_tildetilde (struct val *a, struct val *b)
vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1); vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1);
if (vs == NULL) { if (vs == NULL) {
ast_log(LOG_WARNING, "malloc() failed\n"); ast_log(LOG_WARNING, "malloc() failed\n");
free_value(a);
free_value(b);
return NULL; return NULL;
} }