[asterisk-commits] mvanbaak: branch 1.4 r135055 - /branches/1.4/channels/chan_skinny.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 1 05:55:27 CDT 2008


Author: mvanbaak
Date: Fri Aug  1 05:55:27 2008
New Revision: 135055

URL: http://svn.digium.com/view/asterisk?view=rev&rev=135055
Log:
fix some potential deadlocks in chan_skinny

(closes issue #13215)
Reported by: qwell
Patches:
      2008080100_bug13215.diff.txt uploaded by mvanbaak (license 7)
Tested by: mvanbaak

Modified:
    branches/1.4/channels/chan_skinny.c

Modified: branches/1.4/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_skinny.c?view=diff&rev=135055&r1=135054&r2=135055
==============================================================================
--- branches/1.4/channels/chan_skinny.c (original)
+++ branches/1.4/channels/chan_skinny.c Fri Aug  1 05:55:27 2008
@@ -1476,6 +1476,7 @@
 
 	if (letohl(req->len > SKINNY_MAX_PACKET) || letohl(req->len < 0)) {
 		ast_log(LOG_WARNING, "transmit_response: the length of the request is out of bounds\n");
+		ast_mutex_unlock(&s->lock);
 		return -1;
 	}
 
@@ -4819,6 +4820,7 @@
 		if(setsockopt(skinnysock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) {
 			ast_log(LOG_ERROR, "Set Socket Options failed: errno %d, %s\n", errno, strerror(errno));
 			ast_config_destroy(cfg);
+			ast_mutex_unlock(&netlock);
 			return 0;
 		}
 		if (skinnysock < 0) {
@@ -4831,6 +4833,7 @@
 				close(skinnysock);
 				skinnysock = -1;
 				ast_config_destroy(cfg);
+				ast_mutex_unlock(&netlock);
 				return 0;
 			}
 			if (listen(skinnysock,DEFAULT_SKINNY_BACKLOG)) {
@@ -4840,6 +4843,7 @@
 					close(skinnysock);
 					skinnysock = -1;
 					ast_config_destroy(cfg);
+					ast_mutex_unlock(&netlock);
 					return 0;
 			}
 			if (option_verbose > 1)




More information about the asterisk-commits mailing list