rendered paste bodyIndex: channels/chan_iax2.c
===================================================================
--- channels/chan_iax2.c (revision 114558)
+++ channels/chan_iax2.c (working copy)
@@ -1353,7 +1353,8 @@
res = x;
}
}
- ast_mutex_unlock(&iaxsl[x]);
+ if (res && !return_locked)
+ ast_mutex_unlock(&iaxsl[x]);
}
for (x=TRUNK_CALL_START;(res < 1) && (x<maxtrunkcall);x++) {
ast_mutex_lock(&iaxsl[x]);
@@ -1363,7 +1364,8 @@
res = x;
}
}
- ast_mutex_unlock(&iaxsl[x]);
+ if (res && !return_locked)
+ ast_mutex_unlock(&iaxsl[x]);
}
}
if ((res < 1) && (new >= NEW_ALLOW)) {