[Freeswitch-svn] [commit] r8483 - freeswitch/trunk/src/mod/applications/mod_dptools

Freeswitch SVN mikej at freeswitch.org
Mon May 19 18:34:31 EDT 2008


Author: mikej
Date: Mon May 19 18:34:30 2008
New Revision: 8483

Modified:
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c

Log:
tweak error handling. Found by Klockwork (www.klocwork.com)

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Mon May 19 18:34:30 2008
@@ -1436,7 +1436,7 @@
 		timelimit = atoi(var);
 	}
 
-	if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
+	if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS || !peer_session) {
 		goto end;
 	}
 
@@ -1475,13 +1475,10 @@
 		
 		switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, bond);
 	}
-
- end:
 	
-	if (peer_session) {
-		switch_core_session_rwunlock(peer_session);
-	}
+	switch_core_session_rwunlock(peer_session);
 	
+ end:
 	switch_channel_set_variable(channel, SWITCH_HOLDING_UUID_VARIABLE, NULL);
 }
 



More information about the Freeswitch-svn mailing list