diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-15 18:47:12 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-15 18:47:12 +0000 |
commit | 5599ffdc36bfbd46a56de8385dc929ddf8149760 (patch) | |
tree | 0bcdcdf51248fe082bbb9a2a6769cd197e56c7bf /res | |
parent | d02507ebe50c22e527485e06e4cdab7b5681115b (diff) |
Merged revisions 131072 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r131072 | russell | 2008-07-15 13:46:40 -0500 (Tue, 15 Jul 2008) | 5 lines
Fix a couple of places in res_agi where the agi_commands lock would not be
released, causing a deadlock. (Reported by mvanbaak in #asterisk-dev,
discovered by bbryant's change to the lock tracking code to yell at you
if a thread exits with a lock still held)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@131073 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index da1ef649e..3c72d4898 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -2452,8 +2452,10 @@ static agi_command *find_command(char *cmds[], int exact) if (!e->cmda[y] && !exact) break; /* don't segfault if the next part of a command doesn't exist */ - if (!e->cmda[y]) + if (!e->cmda[y]) { + AST_RWLIST_UNLOCK(&agi_commands); return NULL; + } if (strcasecmp(e->cmda[y], cmds[y])) match = 0; } @@ -2461,8 +2463,10 @@ static agi_command *find_command(char *cmds[], int exact) a candidate (unless we're looking for a really inexact answer */ if ((exact > -1) && e->cmda[y]) match = 0; - if (match) + if (match) { + AST_RWLIST_UNLOCK(&agi_commands); return e; + } } AST_RWLIST_UNLOCK(&agi_commands); return NULL; |