Fix pri->pvt[chan]->owner dereference (bug #1161)
authorJames Golovich <james@gnuinter.net>
Fri, 5 Mar 2004 04:15:55 +0000 (04:15 +0000)
committerJames Golovich <james@gnuinter.net>
Fri, 5 Mar 2004 04:15:55 +0000 (04:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2341 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 706f4c7..32ca907 100755 (executable)
@@ -6510,9 +6510,9 @@ static void *pri_dchannel(void *vpri)
                                                if (!pri->pvt[chan]->alreadyhungup) {
                                                        /* we're calling here zt_hangup so once we get there we need to clear p->call after calling pri_hangup */
                                                        pri->pvt[chan]->alreadyhungup = 1;
-                                                       pri->pvt[chan]->owner->hangupcause = hangup_pri2cause(e->hangup.cause);
                                                        /* Queue a BUSY instead of a hangup if our cause is appropriate */
                                                        if (pri->pvt[chan]->owner) {
+                                                               pri->pvt[chan]->owner->hangupcause = hangup_pri2cause(e->hangup.cause);
                                                                switch(e->hangup.cause) {
                                                                case PRI_CAUSE_USER_BUSY:
                                                                        pri->pvt[chan]->subs[SUB_REAL].needbusy =1;