summaryrefslogtreecommitdiffstats
path: root/libmount/src/cache.c
diff options
context:
space:
mode:
authorKarel Zak2016-02-12 13:09:28 +0100
committerKarel Zak2016-02-12 13:09:28 +0100
commitaf86564357ca39b69bf91b615e412004e1fb5da0 (patch)
tree4d57f18b3ce1a3f38fe72b53e8c4d3679d5ef21e /libmount/src/cache.c
parentsulogin: keep initialization more robust (diff)
downloadkernel-qcow2-util-linux-af86564357ca39b69bf91b615e412004e1fb5da0.tar.gz
kernel-qcow2-util-linux-af86564357ca39b69bf91b615e412004e1fb5da0.tar.xz
kernel-qcow2-util-linux-af86564357ca39b69bf91b615e412004e1fb5da0.zip
libmount: fix memleak in mnt_pretty_path()
References: https://github.com/karelzak/util-linux/issues/275 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/cache.c')
-rw-r--r--libmount/src/cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libmount/src/cache.c b/libmount/src/cache.c
index eb6146d1a..b9b607bb0 100644
--- a/libmount/src/cache.c
+++ b/libmount/src/cache.c
@@ -635,6 +635,7 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
if (loopcxt_is_autoclear(&lc)) {
char *tmp = loopcxt_get_backing_file(&lc);
if (tmp) {
+ loopcxt_deinit(&lc);
if (!cache)
free(pretty); /* not cached, deallocate */
return tmp; /* return backing file */