aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-03 18:42:01 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-03 18:42:01 +0000
commit3e79e0fd609993faa29efba39010bf7c1b01b2ee (patch)
tree4b00066f8a3486ff07646cd362ad220b0fac9518 /apps/app_dial.c
parentf9854b0cdf174c4553d0fe6a5db73006f5b9e6ed (diff)
Merged revisions 160626 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r160626 | mmichelson | 2008-12-03 12:37:46 -0600 (Wed, 03 Dec 2008) | 16 lines Add some safety measures when using gosub, especially when using the options for app_dial and app_queue to run a gosub when the call is answered. * Check for the existence of the gosub target in gosub_exec. If it is nonexistent, then this will cause errors when we attempt to actually run the gosub, including a definite memory leak and potential crashes. Return an error in this situation * Check the return value of pbx_exec in app_dial and app_queue before attempting to actually run the gosub routine. If there was an error, we should not attempt to run the gosub. * Change a '|' to a ',' in app_queue. * Add some extra curly braces where they had been missing previously. (closes issue #13548) Reported by: fiddur ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@160628 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 7afd16650..238ed66e9 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1873,14 +1873,16 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (gosub_args) {
res9 = pbx_exec(peer, theapp, gosub_args);
- ast_pbx_run(peer);
+ if (!res9) {
+ ast_pbx_run(peer);
+ }
ast_free(gosub_args);
if (option_debug)
ast_log(LOG_DEBUG, "Gosub exited with status %d\n", res9);
- } else
+ } else {
ast_log(LOG_ERROR, "Could not Allocate string for Gosub arguments -- Gosub Call Aborted!\n");
+ }
- res9 = 0;
} else if (!res9) {
ast_log(LOG_ERROR, "Could not find application Gosub\n");
res9 = -1;