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
This commit is contained in:
Stefan Knoblich 2008-05-09 09:08:32 +00:00
parent f080f3a454
commit ba0ef07f89
1 changed files with 3 additions and 1 deletions

View File

@ -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);