X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcsv.c;h=07728734cc727ab0f8991480fd27c65298aabed1;hb=213eb227d7737bfbd899474033f94342c61dcb8c;hp=f123c5d6dae1960d6fe91a53c16765d27eda4356;hpb=44dcf2017576cbd398574ac66a732a5d2b179c3c;p=collectd.git diff --git a/src/csv.c b/src/csv.c index f123c5d6..07728734 100644 --- a/src/csv.c +++ b/src/csv.c @@ -17,7 +17,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: - * Florian octo Forster + * Florian octo Forster * Doug MacEachern **/ @@ -25,7 +25,6 @@ #include "plugin.h" #include "common.h" #include "utils_cache.h" -#include "utils_parse_option.h" /* * Private variables @@ -65,13 +64,16 @@ static int value_list_to_string (char *buffer, int buffer_len, && (ds->ds[i].type != DS_TYPE_GAUGE) && (ds->ds[i].type != DS_TYPE_DERIVE) && (ds->ds[i].type != DS_TYPE_ABSOLUTE)) + { + sfree (rates); return (-1); + } - if (ds->ds[i].type == DS_TYPE_GAUGE) + if (ds->ds[i].type == DS_TYPE_GAUGE) { status = ssnprintf (buffer + offset, buffer_len - offset, ",%lf", vl->values[i].gauge); - } + } else if (store_rates != 0) { if (rates == NULL) @@ -215,7 +217,10 @@ static int csv_config (const char *key, const char *value) if (strcasecmp ("DataDir", key) == 0) { if (datadir != NULL) + { free (datadir); + datadir = NULL; + } if (strcasecmp ("stdout", value) == 0) { use_stdio = 1;