diff options
author | Alexei Gradinari <alex2grad@gmail.com> | 2016-06-17 14:51:57 -0400 |
---|---|---|
committer | Alexei Gradinari <alex2grad@gmail.com> | 2016-06-20 13:08:18 -0400 |
commit | 820ed3d4b35d5a906863375f0336e881530fa99c (patch) | |
tree | 76227e16c2da682f6101e5ab07254f25aa91ea67 /main/ast_expr2.c | |
parent | 947f76a971ee54bd263ca5b50ac9446618ae06b1 (diff) |
fix: memory leaks, resource leaks, out of bounds and bugs
ASTERISK-26119 #close
Change-Id: Iecbf7d0f360a021147344c4e83ab242fd1e7512c
Diffstat (limited to 'main/ast_expr2.c')
-rw-r--r-- | main/ast_expr2.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c index c700b01d7..b914598ec 100644 --- a/main/ast_expr2.c +++ b/main/ast_expr2.c @@ -3669,13 +3669,20 @@ op_tildetilde (struct val *a, struct val *b) /* strip double quotes from both -- */ strip_quotes(a); strip_quotes(b); - + vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1); + if (vs == NULL) { + ast_log(LOG_WARNING, "malloc() failed\n"); + return NULL; + } + strcpy(vs,a->u.s); strcat(vs,b->u.s); v = make_str(vs); + free(vs); + /* free arguments */ free_value(a); free_value(b); |