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/trunk@131072 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
cdc7f99d9a
commit
4db5706de8
1 changed files with 6 additions and 2 deletions
|
@ -2434,8 +2434,10 @@ static agi_command *find_command(char *cmds[], int exact)
|
||||||
if (!e->cmda[y] && !exact)
|
if (!e->cmda[y] && !exact)
|
||||||
break;
|
break;
|
||||||
/* don't segfault if the next part of a command doesn't exist */
|
/* 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;
|
return NULL;
|
||||||
|
}
|
||||||
if (strcasecmp(e->cmda[y], cmds[y]))
|
if (strcasecmp(e->cmda[y], cmds[y]))
|
||||||
match = 0;
|
match = 0;
|
||||||
}
|
}
|
||||||
|
@ -2443,9 +2445,11 @@ static agi_command *find_command(char *cmds[], int exact)
|
||||||
a candidate (unless we're looking for a really inexact answer */
|
a candidate (unless we're looking for a really inexact answer */
|
||||||
if ((exact > -1) && e->cmda[y])
|
if ((exact > -1) && e->cmda[y])
|
||||||
match = 0;
|
match = 0;
|
||||||
if (match)
|
if (match) {
|
||||||
|
AST_RWLIST_UNLOCK(&agi_commands);
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AST_RWLIST_UNLOCK(&agi_commands);
|
AST_RWLIST_UNLOCK(&agi_commands);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue