[Freeswitch-svn] [commit] r10297 - freeswitch/trunk/src

FreeSWITCH SVN anthm at freeswitch.org
Fri Nov 7 15:08:57 PST 2008


Author: anthm
Date: Fri Nov  7 18:08:57 2008
New Revision: 10297

Modified:
   freeswitch/trunk/src/switch_core_session.c

Log:
prevent seg

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Fri Nov  7 18:08:57 2008
@@ -79,6 +79,8 @@
 	void *val;
 	switch_core_session_t *session;
 
+	if (!var_val) return;
+
 	switch_mutex_lock(runtime.throttle_mutex);
 	for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
 		switch_hash_this(hi, NULL, NULL, &val);
@@ -86,7 +88,7 @@
 			const char *this_val;
 			session = (switch_core_session_t *) val;
 			switch_core_session_read_lock(session);
-			if ((this_val = switch_channel_get_variable(session->channel, var_name)) && && var_val && (!strcmp(this_val, var_val))) {
+			if ((this_val = switch_channel_get_variable(session->channel, var_name)) && (!strcmp(this_val, var_val))) {
 				switch_channel_hangup(switch_core_session_get_channel(session), cause);
 			}
 			switch_core_session_rwunlock(session);



More information about the Freeswitch-svn mailing list