mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 00:24:05 +00:00
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:
@@ -2572,10 +2572,12 @@ static struct agent_pvt *find_agent(char *agentid)
|
|||||||
{
|
{
|
||||||
struct agent_pvt *cur;
|
struct agent_pvt *cur;
|
||||||
|
|
||||||
|
AST_LIST_LOCK(&agents);
|
||||||
AST_LIST_TRAVERSE(&agents, cur, list) {
|
AST_LIST_TRAVERSE(&agents, cur, list) {
|
||||||
if (!strcmp(cur->agent, agentid))
|
if (!strcmp(cur->agent, agentid))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
AST_LIST_UNLOCK(&agents);
|
||||||
|
|
||||||
return cur;
|
return cur;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user