From: Scott Sanders Date: Sun, 2 Oct 2011 23:41:06 +0000 (-0400) Subject: Oops. Use the new string and free it when done X-Git-Tag: collectd-5.1.0~33^2~25^2~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6c16a604aacf313751cac123ddc04dbf626788f8;p=collectd.git Oops. Use the new string and free it when done --- diff --git a/src/write_graphite.c b/src/write_graphite.c index 2d80dbb7..9f7e5e74 100644 --- a/src/write_graphite.c +++ b/src/write_graphite.c @@ -371,7 +371,7 @@ static int wg_format_name (char *ret, int ret_len, prefix, n_hostname, plugin, type); else status = ssnprintf (ret, ret_len, "%s.%s.%s.%s.%s", - prefix, n_hostname, plugin, type, ds_name); + prefix, n_hostname, plugin, type, n_ds_name); } else { @@ -382,7 +382,7 @@ static int wg_format_name (char *ret, int ret_len, else status = ssnprintf (ret, ret_len, "%s.%s.%s.%s-%s.%s", prefix, n_hostname, plugin, type, - type_instance, ds_name); + type_instance, n_ds_name); } } else @@ -396,7 +396,7 @@ static int wg_format_name (char *ret, int ret_len, else status = ssnprintf (ret, ret_len, "%s.%s.%s.%s.%s.%s", prefix, n_hostname, plugin, - plugin_instance, type, ds_name); + plugin_instance, type, n_ds_name); } else { @@ -407,11 +407,12 @@ static int wg_format_name (char *ret, int ret_len, else status = ssnprintf (ret, ret_len, "%s.%s.%s.%s.%s-%s.%s", prefix, n_hostname, plugin, - plugin_instance, type, type_instance, ds_name); + plugin_instance, type, type_instance, n_ds_name); } } sfree(n_hostname); + sfree(n_ds_name); if ((status < 1) || (status >= ret_len)) return (-1);