Add missing locking to the find_agent() function.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2008-01-31 19:04:52 +00:00
parent 7b31f51cf9
commit c6c7c3bf58

View File

@@ -2572,10 +2572,12 @@ static struct agent_pvt *find_agent(char *agentid)
{
struct agent_pvt *cur;
AST_LIST_LOCK(&agents);
AST_LIST_TRAVERSE(&agents, cur, list) {
if (!strcmp(cur->agent, agentid))
break;
}
AST_LIST_UNLOCK(&agents);
return cur;
}