From: Russell Bryant Date: Sat, 7 Feb 2009 16:15:07 +0000 (+0000) Subject: Fix a race condition that could cause a crash. X-Git-Tag: 1.4.24-rc1~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c347a43c9feef90e99218385bc93a4ffa46f861f;p=thirdparty%2Fasterisk.git Fix a race condition that could cause a crash. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174148 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/snmp/agent.c b/res/snmp/agent.c index 96398e8a89..08bdd96ece 100644 --- a/res/snmp/agent.c +++ b/res/snmp/agent.c @@ -573,9 +573,9 @@ static u_char *ast_var_channel_types_table(struct variable *vp, oid *name, size_ case ASTCHANTYPECHANNELS: long_ret = 0; for (chan = ast_channel_walk_locked(NULL); chan; chan = ast_channel_walk_locked(chan)) { - ast_channel_unlock(chan); if (chan->tech == tech) long_ret++; + ast_channel_unlock(chan); } return (u_char *)&long_ret; default: