diff options
Diffstat (limited to 'apps/app_while.c')
-rwxr-xr-x | apps/app_while.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/app_while.c b/apps/app_while.c index 49c631221..4f6a54144 100755 --- a/apps/app_while.c +++ b/apps/app_while.c @@ -84,7 +84,14 @@ static int execif_exec(struct ast_channel *chan, void *data) { struct ast_app *app = NULL; LOCAL_USER_ADD(u); - expr = ast_strdupa((char *) data); + + expr = ast_strdupa(data); + if (!expr) { + ast_log(LOG_ERROR, "Out of memory\n"); + LOCAL_USER_REMOVE(u); + return -1; + } + if ((myapp = strchr(expr,'|'))) { *myapp = '\0'; myapp++; |