]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: fix memory leak in config parser
authorSamanta Navarro <ferivoz@riseup.net>
Sun, 8 Nov 2020 11:44:55 +0000 (11:44 +0000)
committerKarel Zak <kzak@redhat.com>
Fri, 13 Nov 2020 11:35:50 +0000 (12:35 +0100)
commit4f3de85b5e16be8b59cd451818585f97650829b3
tree79ac57e3e54eab6c069709b7763155c06694e8f3
parent03fbc0ed4c17a4477c7a6bd71715fa79e278d9f3
libblkid: fix memory leak in config parser

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>
libblkid/src/config.c