[asterisk-commits] rizzo: branch 1.4 r44746 - /branches/1.4/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Oct 8 07:14:15 MST 2006


Author: rizzo
Date: Sun Oct  8 09:14:14 2006
New Revision: 44746

URL: http://svn.digium.com/view/asterisk?rev=44746&view=rev
Log:
merge svn 44744: do not dereference p if we know it is NULL


Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?rev=44746&r1=44745&r2=44746&view=diff
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Sun Oct  8 09:14:14 2006
@@ -14379,7 +14379,10 @@
 
 	/* Find the active SIP dialog or create a new one */
 	p = find_call(&req, &sin, req.method);	/* returns p locked */
-	if (p) {
+	if (p == NULL) {
+		if (option_debug)
+			ast_log(LOG_DEBUG, "Invalid SIP message - rejected , no callid, len %d\n", req.len);
+	} else {
 		/* Go ahead and lock the owner if it has one -- we may need it */
 		/* becaues this is deadlock-prone, we need to try and unlock if failed */
 		if (p->owner && ast_channel_trylock(p->owner)) {
@@ -14415,9 +14418,6 @@
 		if (p->owner && !nounlock)
 			ast_channel_unlock(p->owner);
 		ast_mutex_unlock(&p->lock);
-	} else {
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Invalid SIP message - rejected , bad request: %-70.70s\n", p->callid[0] ? p->callid : "<no callid>");
 	}
 	ast_mutex_unlock(&netlock);
 	if (recount)



More information about the asterisk-commits mailing list