make this work again, and not segfault on device registration
authorMichiel van Baak <michiel@vanbaak.info>
Sat, 2 Aug 2008 13:56:00 +0000 (13:56 +0000)
committerMichiel van Baak <michiel@vanbaak.info>
Sat, 2 Aug 2008 13:56:00 +0000 (13:56 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135332 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_skinny.c

index 0f96280..5afeabb 100644 (file)
@@ -4166,7 +4166,7 @@ static int handle_keep_alive_message(struct skinny_req *req, struct skinnysessio
 
 static int handle_register_message(struct skinny_req *req, struct skinnysession *s)
 {
-       struct skinny_device *d = s->device;
+       struct skinny_device *d = NULL;
        char name[16];
        int res;
 
@@ -4184,6 +4184,8 @@ static int handle_register_message(struct skinny_req *req, struct skinnysession
                return 0;
        }
        ast_verb(3, "Device '%s' successfully registered\n", name);
+
+       d = s->device;
        
        if (!(req = req_alloc(sizeof(struct register_ack_message), REGISTER_ACK_MESSAGE)))
                return -1;