[asterisk-commits] wedhorn: branch 10 r340031 - /branches/10/channels/chan_skinny.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 9 17:18:31 CDT 2011


Author: wedhorn
Date: Sun Oct  9 17:18:27 2011
New Revision: 340031

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=340031
Log:
Return -1 to skinny_session if register rejected.

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.


Modified:
    branches/10/channels/chan_skinny.c

Modified: branches/10/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/chan_skinny.c?view=diff&rev=340031&r1=340030&r2=340031
==============================================================================
--- branches/10/channels/chan_skinny.c (original)
+++ branches/10/channels/chan_skinny.c Sun Oct  9 17:18:27 2011
@@ -6615,6 +6615,8 @@
 			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 @@
 			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;
 			}
 		}




More information about the asterisk-commits mailing list