aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-01 10:55:27 +0000
committermvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-01 10:55:27 +0000
commit9c3c3b59cd855c5c4347ced8be1e611c715d9dfd (patch)
tree8911b828e2cc3417a7ecbe3bd147f59e42e4249e /channels
parent2795a354555544039c582ae934ffd06a0bf608de (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@135055 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_skinny.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 2e796e7c4..80ce09201 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1476,6 +1476,7 @@ static int transmit_response(struct skinnysession *s, struct skinny_req *req)
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 @@ static int reload_config(void)
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 @@ static int reload_config(void)
close(skinnysock);
skinnysock = -1;
ast_config_destroy(cfg);
+ ast_mutex_unlock(&netlock);
return 0;
}
if (listen(skinnysock,DEFAULT_SKINNY_BACKLOG)) {
@@ -4840,6 +4843,7 @@ static int reload_config(void)
close(skinnysock);
skinnysock = -1;
ast_config_destroy(cfg);
+ ast_mutex_unlock(&netlock);
return 0;
}
if (option_verbose > 1)