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: https://origsvn.digium.com/svn/asterisk/trunk@131072
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
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;
}
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;