]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix memleak in mnt_pretty_path()
authorKarel Zak <kzak@redhat.com>
Fri, 12 Feb 2016 12:09:28 +0000 (13:09 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 12 Feb 2016 12:09:28 +0000 (13:09 +0100)
References: https://github.com/karelzak/util-linux/issues/275
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/cache.c

index eb6146d1a2bca74ad5eb17f5aa2a70415dff5cb2..b9b607bb00e94c0812ca5040afc4de46ab585ea5 100644 (file)
@@ -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 */