From: Manuel Luis Sanmartin Rozada Date: Tue, 6 Aug 2013 10:30:52 +0000 (+0200) Subject: csv plugin: set datadir null when free X-Git-Tag: collectd-5.4.0~1^2^2~2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=d8a5927958995e2c62d5c32a395a724db1af9123;p=collectd.git csv plugin: set datadir null when free If you define twice DataDir: DataDir "/opt/collectd/var/lib/collectd/csv" DataDir stdout the second time datadir will not be null and you will get garbage in value_list_to_filename Signed-off-by: Florian Forster --- diff --git a/src/csv.c b/src/csv.c index f123c5d6..958e34ba 100644 --- a/src/csv.c +++ b/src/csv.c @@ -215,7 +215,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;