projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7221306
)
Fix memory leak in redis.c
author
Michael Spiegle
<mspiegle@myspace-inc.com>
Fri, 10 Jan 2014 00:48:47 +0000
(
00:48
+0000)
committer
Marc Fournier
<marc.fournier@camptocamp.com>
Fri, 7 Nov 2014 21:46:20 +0000
(22:46 +0100)
src/redis.c
patch
|
blob
|
history
diff --git
a/src/redis.c
b/src/redis.c
index
47e229e
..
f1a88b2
100644
(file)
--- a/
src/redis.c
+++ b/
src/redis.c
@@
-278,9
+278,12
@@
static int redis_read (void) /* {{{ */
DEBUG ("redis plugin: authenticanting node `%s' passwd(%s).", rn->name, rn->passwd);
rr = redisCommand (rh, "AUTH %s", rn->passwd);
DEBUG ("redis plugin: authenticanting node `%s' passwd(%s).", rn->name, rn->passwd);
rr = redisCommand (rh, "AUTH %s", rn->passwd);
- if (rr == NULL || rr->type !=
5
)
+ if (rr == NULL || rr->type !=
REDIS_REPLY_STATUS
)
{
WARNING ("redis plugin: unable to authenticate on node `%s'.", rn->name);
{
WARNING ("redis plugin: unable to authenticate on node `%s'.", rn->name);
+ if (rr != NULL)
+ freeReplyObject (rr);
+
redisFree (rh);
continue;
}
redisFree (rh);
continue;
}
@@
-307,6
+310,7
@@
static int redis_read (void) /* {{{ */
redis_handle_info (rn->name, rr->str, "pubsub", "patterns", "pubsub_patterns", DS_TYPE_GAUGE);
redis_handle_info (rn->name, rr->str, "current_connections", "slaves", "connected_slaves", DS_TYPE_GAUGE);
redis_handle_info (rn->name, rr->str, "pubsub", "patterns", "pubsub_patterns", DS_TYPE_GAUGE);
redis_handle_info (rn->name, rr->str, "current_connections", "slaves", "connected_slaves", DS_TYPE_GAUGE);
+ freeReplyObject (rr);
redisFree (rh);
}
redisFree (rh);
}