]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add missing locking to the find_agent() function.
authorRussell Bryant <russell@russellbryant.com>
Thu, 31 Jan 2008 19:04:52 +0000 (19:04 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 31 Jan 2008 19:04:52 +0000 (19:04 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101413 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index 6937640b1f8a944194e5e8480b1cf0a7736acb3f..4163072b692d47be2143153c14c9e00911cd4974 100644 (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;     
 }