From 875f87ab541c91e942da91b6a1f63902feb4f2b9 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 23 Feb 2007 21:00:20 +0000 Subject: [PATCH] fix segfault on incorrect usage of originate api command (jira MODAPP-2) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4378 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_commands/mod_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 71d7ef735f..9aebcb82eb 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -522,10 +522,10 @@ static switch_status_t originate_function(char *cmd, switch_core_session_t *ises assert(caller_channel != NULL); switch_channel_clear_state_handler(caller_channel, NULL); - if (*exten == '&') { + if (*exten == '&' && *(exten + 1)) { switch_caller_extension_t *extension = NULL; char *app_name = switch_core_session_strdup(caller_session, (exten + 1)); - char *arg, *e; + char *arg = NULL, *e; if ((e = strchr(app_name, ')'))) { *e = '\0';