Fix segfault on answer.
authorDamien Wedhorn <voip@facts.com.au>
Thu, 8 Dec 2011 06:59:01 +0000 (06:59 +0000)
committerDamien Wedhorn <voip@facts.com.au>
Thu, 8 Dec 2011 06:59:01 +0000 (06:59 +0000)
Fix a segfault if an attempt to answer a call is made between when
the inbound call gives up (and the channel is removed) and when the
device is notified and removes the call from the device.

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

channels/chan_skinny.c

index 3799747..f65d377 100644 (file)
@@ -5935,7 +5935,9 @@ static int handle_offhook_message(struct skinny_req *req, struct skinnysession *
 
        if (reference) {
                sub = find_subchannel_by_instance_reference(d, instance, reference);
-               l = sub->line;
+               if (sub) {
+                       l = sub->line;
+               }
        }
        if (!sub) {
                if (instance) {