]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Return -1 to skinny_session if register rejected.
authorDamien Wedhorn <voip@facts.com.au>
Sun, 9 Oct 2011 22:18:27 +0000 (22:18 +0000)
committerDamien Wedhorn <voip@facts.com.au>
Sun, 9 Oct 2011 22:18:27 +0000 (22:18 +0000)
If device registration is rejected, return -1 so that the session is
destroyed immediately. Previously, a segfault would occur on a
graceful shutdown if a register is rejected and the skinny_session
has not yet timed out.

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

channels/chan_skinny.c

index d792ee4c66c9485efcb00a927fb46aef6e336256..0877684f1ac465b2c688583f1336061e58751fe6 100644 (file)
@@ -6615,6 +6615,8 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
                        transmit_capabilitiesreq(s->device);
                } else {
                        transmit_registerrej(s);
+                       ast_free(req);
+                       return -1;
                }
        case IP_PORT_MESSAGE:
                res = handle_ip_port_message(req, s);
@@ -6934,6 +6936,7 @@ static void *skinny_session(void *data)
                        res = handle_message(req, s);
                        if (res < 0) {
                                destroy_session(s);
+                               ast_verb(3, "Ending Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
                                return NULL;
                        }
                }