]> 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)
committerSamanta Navarro <ferivoz@riseup.net>
Sun, 8 Nov 2020 11:47:33 +0000 (11:47 +0000)
commit02162731c1899613bce2aafc825acc7baa3cc99a
treecd4893e68b41b02e9189909bc8e043ae840ef6f6
parentee7f4bee9b503176bed57882ca5e8ba4d6a15c3e
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