From 6d1f4f6de1bb3a1c8251560cdd567c0e0eb3623e Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 1 Apr 2008 02:34:58 +0000 Subject: [PATCH] potential fix for MODLANG-54 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7995 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_cpp.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index 90a294713d..7005545caf 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -85,10 +85,12 @@ CoreSession::CoreSession(switch_core_session_t *new_session) { memset(&caller_profile, 0, sizeof(caller_profile)); init_vars(); - session = new_session; - channel = switch_core_session_get_channel(session); - allocated = 1; - switch_core_session_read_lock(session); + if (new_session) { + session = new_session; + channel = switch_core_session_get_channel(session); + allocated = 1; + switch_core_session_read_lock(session); + } } CoreSession::~CoreSession()