Merged revisions 174148 via svnmerge from
[asterisk/asterisk.git] / res / snmp / agent.c
index 6acf536..0a47879 100644 (file)
@@ -569,9 +569,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: