From: Mark Michelson Date: Tue, 16 Dec 2008 23:04:27 +0000 (+0000) Subject: After looking through SIP registration code most of the day, this X-Git-Tag: 1.4.23-rc3~3^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c49c8b9a3a76aa10dd6cf6a6b49dad54e6f339f3;p=thirdparty%2Fasterisk.git 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/branches/1.4@164977 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index d478892da2..b3367e4886 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7627,7 +7627,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; }