projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a065c5
)
redis plugin: Fix memleak
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Tue, 19 Jun 2018 16:19:34 +0000
(23:19 +0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Tue, 19 Jun 2018 16:19:34 +0000
(23:19 +0700)
src/redis.c
patch
|
blob
|
history
diff --git
a/src/redis.c
b/src/redis.c
index
23234b8
..
36f57b0
100644
(file)
--- a/
src/redis.c
+++ b/
src/redis.c
@@
-316,8
+316,12
@@
static int redis_init(void) /* {{{ */
rn->name = strdup("default");
rn->host = strdup(REDIS_DEF_HOST);
- if (rn->name == NULL || rn->host == NULL)
+ if (rn->name == NULL || rn->host == NULL) {
+ sfree(rn->name);
+ sfree(rn->host);
+ sfree(rn);
return ENOMEM;
+ }
return redis_node_add(rn);
} /* }}} int redis_init */