[commit] r4889 - freeswitch/trunk/src/mod/applications/mod_commands
Author: brian Date: Sat Apr 7 23:53:35 2007 New Revision: 4889 Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Log: fix segfault thanks bblack Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original) +++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Sat Apr 7 23:53:35 2007 @@ -27,6 +27,7 @@ * Michael Jerris <mike@jerris.com> * Johny Kadarisman <jkr888@gmail.com> * Paul Tinsley <jackhammer@gmail.com> + * Marcel Barbulescu <marcelbarbulescu@gmail.com> * * * mod_commands.c -- Misc. Command Module @@ -901,19 +902,21 @@ int help = 0; char *mydata, *argv[5] = {0}; int argc; - char *cmd, *as = NULL; + char *cmd = NULL, *as = NULL; if (session) { return SWITCH_STATUS_FALSE; } - if ((mydata = strdup(data))) { - argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - cmd = argv[0]; - if (argv[2] && !strcasecmp(argv[1], "as")) { - as = argv[2]; + if (data) { + if ((mydata = strdup(data))) { + argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + cmd = argv[0]; + if (argv[2] && !strcasecmp(argv[1], "as")) { + as = argv[2]; + } } if (!as && stream->event) {
participants (1)
-
Freeswitch SVN