From fba429409ee60fdbb73dfe6968d08fd78fcd6b89 Mon Sep 17 00:00:00 2001
From: Matthew Jordan <mjordan@digium.com>
Date: Sat, 10 Aug 2013 04:18:33 +0000
Subject: [PATCH] Unlock the dial operation lock on a failed dial

If a dial operation fails, the pbx_outgoing_attempt routine will exit without
first having unlocked the outgoing dial lock. This would be a "bad thing".


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/pbx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/main/pbx.c b/main/pbx.c
index ec96344cbb..4db89f803a 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -9983,6 +9983,7 @@ static int pbx_outgoing_attempt(const char *type, struct ast_format_cap *cap, co
 			ast_cond_wait(&outgoing->cond, &outgoing->lock);
 
 			if (outgoing->dial_res != AST_DIAL_RESULT_ANSWERED) {
+				ast_mutex_unlock(&outgoing->lock);
 				/* The dial operation failed. */
 				return -1;
 			}
-- 
GitLab