[asterisk-commits] russell: branch 1.4 r174148 - /branches/1.4/res/snmp/agent.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Feb 7 10:15:08 CST 2009


Author: russell
Date: Sat Feb  7 10:15:07 2009
New Revision: 174148

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=174148
Log:
Fix a race condition that could cause a crash.

Modified:
    branches/1.4/res/snmp/agent.c

Modified: branches/1.4/res/snmp/agent.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/res/snmp/agent.c?view=diff&rev=174148&r1=174147&r2=174148
==============================================================================
--- branches/1.4/res/snmp/agent.c (original)
+++ branches/1.4/res/snmp/agent.c Sat Feb  7 10:15:07 2009
@@ -573,9 +573,9 @@
 	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:




More information about the asterisk-commits mailing list