diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-10-08 14:10:26 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-10-08 14:10:26 +0000 |
commit | b90f91c3b40770effa6fd61c6654129ed2ad345f (patch) | |
tree | b0fc6c132bd95d107a4a83c42d389db30e8b0261 | |
parent | 1b64c413695ba8a14c185ae3976e1f720171280b (diff) |
do not dereference p if we know it is NULL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 4ddc74250..f8f499298 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -14332,7 +14332,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)) { @@ -14368,9 +14371,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 : "<no callid>"); } ast_mutex_unlock(&netlock); if (recount) |