diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-23 17:16:32 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-23 17:16:32 +0000 |
commit | 433c8135fe0bc849bae07b5af6d2dea66c06eca8 (patch) | |
tree | 586bd0ea4c2214470effca73e79d3e22ec8936f7 /channels/chan_iax2.c | |
parent | 206ac4feabe75a454a57efae72b54e20b939886b (diff) |
Fix find_callno_locked() to actually return the callno locked in some more cases.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114587 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 823c4a3c7..f30ea54f8 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -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)) { |