summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-12-16 23:06:04 +0000
committerMark Michelson <mmichelson@digium.com>2008-12-16 23:06:04 +0000
commit1d2b4e7a02c94f764162fc1b78cf11e1d1eadf29 (patch)
tree1050cf70b11c338096c8aea9cc863b23676d2d3a
parent27cbfc1bd5b0f80de5d5968c8b1965c2252b23c1 (diff)
Merged revisions 164977 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r164977 | mmichelson | 2008-12-16 17:04:27 -0600 (Tue, 16 Dec 2008) | 7 lines After looking through SIP registration code most of the day, this is one of the few things I could find that was just plain wrong. Even though it probably isn't possible for it to happen, it seems weird to have code that checks if a pointer is NULL and then immediately dereferences that pointer if it was NULL. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 73fece92f..a21631623 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10443,7 +10443,9 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
/* exit if we are already in process with this registrar ?*/
if (r == NULL || ((auth == NULL) && (r->regstate == REG_STATE_REGSENT || r->regstate == REG_STATE_AUTHSENT))) {
- ast_log(LOG_NOTICE, "Strange, trying to register %s@%s when registration already pending\n", r->username, r->hostname);
+ if (r) {
+ ast_log(LOG_NOTICE, "Strange, trying to register %s@%s when registration already pending\n", r->username, r->hostname);
+ }
return 0;
}