diff options
Diffstat (limited to 'main/ast_expr2.y')
-rw-r--r-- | main/ast_expr2.y | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/ast_expr2.y b/main/ast_expr2.y index 869dfe9ea..913bc2662 100644 --- a/main/ast_expr2.y +++ b/main/ast_expr2.y @@ -1661,13 +1661,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); |