aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index d35f35642..8c826626a 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -225,7 +225,11 @@ static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_fra
/* Ensure that we have both channels locked */
while (other && ast_channel_trylock(other)) {
- ast_mutex_unlock(&p->lock);
+ int res;
+ if ((res = ast_mutex_unlock(&p->lock))) {
+ ast_log(LOG_ERROR, "chan_local bug! '&p->lock' was not locked when entering local_queue_frame! (%s)\n", strerror(res));
+ return -1;
+ }
if (us && us_locked) {
do {
CHANNEL_DEADLOCK_AVOIDANCE(us);