]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_commands: check for zstr(cmd) in escape_function
authorMathieu Rene <mrene@avgs.ca>
Tue, 22 Dec 2009 21:44:46 +0000 (21:44 +0000)
committerMathieu Rene <mrene@avgs.ca>
Tue, 22 Dec 2009 21:44:46 +0000 (21:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16029 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_commands/mod_commands.c

index fff64580f8933e12516febd63145c99deff02484..7c977f218cb28589e348af8d34d05c38dd2c7955 100644 (file)
@@ -3866,8 +3866,15 @@ SWITCH_STANDARD_API(hupall_api_function)
 
 SWITCH_STANDARD_API(escape_function)
 {
-       int len = strlen(cmd)*2;
-       char *mycmd = malloc(strlen(cmd)*2);
+       int len;
+       char *mycmd;
+       
+       if (zstr(cmd)) {
+               return SWITCH_STATUS_SUCCESS;
+       }
+       
+       len = strlen(cmd)*2;
+       mycmd = malloc(len);
        
        stream->write_function(stream, "%s", switch_escape_string(cmd, mycmd, len));