The variable used for the return value must be declared as static. I broke
authorRussell Bryant <russell@russellbryant.com>
Wed, 13 Jun 2007 16:05:22 +0000 (16:05 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 13 Jun 2007 16:05:22 +0000 (16:05 +0000)
this when applying the patch, sorry!
(issue #9637, jeffg)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69067 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/snmp/agent.c

index b282d8b..d6c4719 100644 (file)
@@ -590,14 +590,14 @@ static u_char *ast_var_channel_types_table(struct variable *vp, oid *name, size_
 static u_char *ast_var_channel_bridge(struct variable *vp, oid *name, size_t *length,
        int exact, size_t *var_len, WriteMethod **write_method)
 {
-       unsigned long long_ret = 0;
+       static unsigned long long_ret = 0;
        struct ast_channel *chan = NULL;
 
        if (header_generic(vp, name, length, exact, var_len, write_method))
                return NULL;
 
        while ((chan = ast_channel_walk_locked(chan))) {
-               if (ast_bridged_channel(chan) != NULL)
+               if (ast_bridged_channel(chan))
                        long_ret++;
                ast_channel_unlock(chan);
        }