projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1611 from stefanth/Collection3/graph-rendering-speedup
[collectd.git]
/
src
/
write_sensu.c
diff --git
a/src/write_sensu.c
b/src/write_sensu.c
index
b0cf9fa
..
5e231a5
100644
(file)
--- a/
src/write_sensu.c
+++ b/
src/write_sensu.c
@@
-24,6
+24,8
@@
* Fabrice A. Marie <fabrice at kibinlabs.com>
*/
* Fabrice A. Marie <fabrice at kibinlabs.com>
*/
+#define _GNU_SOURCE
+
#include "collectd.h"
#include "plugin.h"
#include "common.h"
#include "collectd.h"
#include "plugin.h"
#include "common.h"
@@
-522,11
+524,10
@@
static char *replace_str(const char *str, const char *old, /* {{{ */
} else
retlen = strlen(str);
} 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.
if (ret == NULL)
return NULL;
// added to original: not optimized, but keeps valgrind happy.
- memset(ret, 0, retlen + 1);
r = ret;
p = str;
r = ret;
p = str;