From: Luigi Rizzo Date: Sun, 8 Oct 2006 14:14:14 +0000 (+0000) Subject: merge svn 44744: do not dereference p if we know it is NULL X-Git-Tag: 1.4.0-beta3~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d88cfa8dce6ea30004a5e5c8e38656a482a1b3d;p=thirdparty%2Fasterisk.git merge svn 44744: do not dereference p if we know it is NULL git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44746 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 7295cd605d..c22c1ca486 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -14379,7 +14379,10 @@ retrylock: /* 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 @@ retrylock: 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 : ""); } ast_mutex_unlock(&netlock); if (recount)