Fix a crash due to a potentially NULL p->options.
authorMark Michelson <mmichelson@digium.com>
Thu, 11 Jun 2009 21:17:14 +0000 (21:17 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 11 Jun 2009 21:17:14 +0000 (21:17 +0000)
Thanks to mnicholson for pointing it out.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200146 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 0117197..23eaa69 100644 (file)
@@ -8971,7 +8971,7 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in
         * Similarly, if we need to re-send an INVITE with auth credentials, then we
         * need to use the same branch as we did the first time we sent the INVITE.
         */
-       if (sipmethod == SIP_CANCEL || (sipmethod == SIP_INVITE && !ast_strlen_zero(p->options->auth))) {
+       if (sipmethod == SIP_CANCEL || (sipmethod == SIP_INVITE && p->options && !ast_strlen_zero(p->options->auth))) {
                p->branch = p->invite_branch;
                build_via(p);
        } else if (newbranch) {