Multiple occurrences of CACHE_FILE lead to memory leaks.
Also if last occurrence of CACHE_FILE is empty then cache file is not
set to NULL again.
An example /etc/blkid.conf could be:
CACHE_FILE=/tmp/cache1
CACHE_FILE=/tmp/cache2
CACHE_FILE=
I would expect that CACHE_FILE is empty but actually it is still
/tmp/cache2.
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
conf->uevent = FALSE;
} else if (!strncmp(s, "CACHE_FILE=", 11)) {
s += 11;
+ free(conf->cachefile);
if (*s)
conf->cachefile = strdup(s);
+ else
+ conf->cachefile = NULL;
} else if (!strncmp(s, "EVALUATE=", 9)) {
s += 9;
if (*s && parse_evaluate(conf, s) == -1)