All pastes #994697 Raw Edit

Mine

public text v1 · immutable
#994697 ·published 2008-04-23 16:32 UTC
rendered paste body
Index: 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)) {