From: Stefan Knoblich Date: Fri, 9 May 2008 09:08:32 +0000 (+0000) Subject: Fix segfault if no arg has been specified, there is still some other issue lurking... X-Git-Tag: v1.0-rc5~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba0ef07f890be81eb88122d7feccbf0fc5d55a41;p=thirdparty%2Ffreeswitch.git Fix segfault if no arg has been specified, there is still some other issue lurking in the code though git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8327 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp index 65a76768e2..93c3138ba0 100644 --- a/src/mod/languages/mod_lua/freeswitch_lua.cpp +++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp @@ -130,7 +130,9 @@ void Session::setHangupHook(char *func, char *arg) { if (func) { hangup_func_str = strdup(func); - hangup_func_arg = strdup(arg); + if (arg) { + hangup_func_arg = strdup(arg); + } switch_channel_set_private(channel, "CoreSession", this); hook_state = switch_channel_get_state(channel); switch_core_event_hook_add_state_change(session, lua_hanguphook);