From: Scott Sanders Date: Sun, 2 Oct 2011 23:56:24 +0000 (-0400) Subject: Must be getting tired... X-Git-Tag: collectd-5.1.0~35^2~25^2~8 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f7958d71313733156ba9ff1d36c7e54ac5df41f7;p=collectd.git Must be getting tired... --- diff --git a/src/write_graphite.c b/src/write_graphite.c index 9f7e5e74..870ce2bb 100644 --- a/src/write_graphite.c +++ b/src/write_graphite.c @@ -354,6 +354,12 @@ static int wg_format_name (char *ret, int ret_len, return (-1); } + if ((n_ds_name = malloc(strlen(ds_name)+1)) == NULL) + { + ERROR ("Unable to allocate memory for normalized datasource name buffer"); + return (-1); + } + if (ds_name && ds_name[0] != '\0') { if (mangle_dots(n_ds_name, ds_name) == -1) {