projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7d3796
)
write_sensu plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:44:18 +0000
(18:44 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:44:18 +0000
(18:44 +0200)
src/write_sensu.c
patch
|
blob
|
history
diff --git
a/src/write_sensu.c
b/src/write_sensu.c
index
aae5d8b
..
5e231a5
100644
(file)
--- a/
src/write_sensu.c
+++ b/
src/write_sensu.c
@@
-524,11
+524,10
@@
static char *replace_str(const char *str, const char *old, /* {{{ */
} else
retlen = strlen(str);
- ret =
malloc(
retlen + 1);
+ ret =
calloc(1,
retlen + 1);
if (ret == NULL)
return NULL;
// added to original: not optimized, but keeps valgrind happy.
- memset(ret, 0, retlen + 1);
r = ret;
p = str;