]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix find_callno_locked() to actually return the callno locked in some more cases.
authorRussell Bryant <russell@russellbryant.com>
Wed, 23 Apr 2008 17:16:32 +0000 (17:16 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 23 Apr 2008 17:16:32 +0000 (17:16 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114587 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 823c4a3c7d9251ea7a0782ecd6e3710d5f3a36a2..f30ea54f8bb8e89b430447506d577eab340ecaf0 100644 (file)
@@ -1353,7 +1353,8 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
                                        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 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
                                        res = x;
                                }
                        }
-                       ast_mutex_unlock(&iaxsl[x]);
+                       if (res && !return_locked)
+                               ast_mutex_unlock(&iaxsl[x]);
                }
        }
        if ((res < 1) && (new >= NEW_ALLOW)) {