diff options
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index bc04deb46..81e822355 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3940,10 +3940,16 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce gosub_argstart = strchr(gosubexec, ','); if (gosub_argstart) { *gosub_argstart = 0; - asprintf(&gosub_args, "%s,s,1(%s)", gosubexec, gosub_argstart + 1); + if (asprintf(&gosub_args, "%s,s,1(%s)", gosubexec, gosub_argstart + 1) < 0) { + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + gosub_args = NULL; + } *gosub_argstart = '|'; } else { - asprintf(&gosub_args, "%s,s,1", gosubexec); + if (asprintf(&gosub_args, "%s,s,1", gosubexec) < 0) { + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + gosub_args = NULL; + } } if (gosub_args) { res = pbx_exec(qe->chan, application, gosub_args); |