diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 404cd44a83..4d53ca3ab7 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1500,7 +1500,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