diff --git a/main/channel.c b/main/channel.c index 477bc815b25cf7c4057547de283edc36caa7a1b9..9100f2671d9931f8f6af674560884dc02f7522a6 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;