summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-09-21 01:15:40 +0000
committerMatthew Jordan <mjordan@digium.com>2014-09-21 01:15:40 +0000
commitd85e59a23b773e5860353ea5c3ca1813a2913c3e (patch)
tree9d38d2a0bab3f499ef498eb6c1fe9fc79357d37d /main/channel.c
parentf48d3f849d5dc34f50bdf7239ab5dca2ffdf9d0b (diff)
main/channel: Unlock channel in off-nominal path
In r423414 (13) / r423415 (trunk), an API call that determines if a format capability structure is empty was added. This returns true if the format capability structure is completely empty or "none". A check for this was added in channel.c's set_format call. Unfortunately, when this check was true, it returned from the function while still holding the channel lock. This caused the CDR unit tests - which have a tendency to create channels with no formats - to deadlock. Whoops. This patch unlocks the channel on the off-nominal path. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@423641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 477bc815b..9100f2671 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -5328,6 +5328,7 @@ static int set_format(struct ast_channel *chan, struct ast_format_cap *cap_set,
cap_native = ast_channel_nativeformats(chan);
if (ast_format_cap_empty(cap_native)) {
+ ast_channel_unlock(chan);
ast_log(LOG_ERROR, "Unable to set format because channel %s supports no formats\n",
ast_channel_name(chan));
return -1;