diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index f30ea54f8b..d44163e226 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1353,7 +1353,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s res = x; } } - if (res && !return_locked) + if (!res || (res && !return_locked)) ast_mutex_unlock(&iaxsl[x]); } for (x=TRUNK_CALL_START;(res < 1) && (x