summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/cache.c
diff options
context:
space:
mode:
authorKarel Zak2011-03-30 23:52:56 +0200
committerKarel Zak2011-03-30 23:52:56 +0200
commit2b6bd96f2b9998d573a5241c9e299ff4dd14bd2a (patch)
tree8a9a8803180cce472126decae8368ba22ea323fc /shlibs/mount/src/cache.c
parentlibmount: add phelper= support (diff)
downloadkernel-qcow2-util-linux-2b6bd96f2b9998d573a5241c9e299ff4dd14bd2a.tar.gz
kernel-qcow2-util-linux-2b6bd96f2b9998d573a5241c9e299ff4dd14bd2a.tar.xz
kernel-qcow2-util-linux-2b6bd96f2b9998d573a5241c9e299ff4dd14bd2a.zip
libmount: fix memory leak in cache
Reported-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/cache.c')
-rw-r--r--shlibs/mount/src/cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shlibs/mount/src/cache.c b/shlibs/mount/src/cache.c
index e0641c172..18b6cd49a 100644
--- a/shlibs/mount/src/cache.c
+++ b/shlibs/mount/src/cache.c
@@ -457,8 +457,8 @@ char *mnt_resolve_path(const char *path, struct libmnt_cache *cache)
p = canonicalize_path(path);
if (p && cache) {
- native = strdup(path);
- real = strcmp(path, p) == 0 ? native : p;
+ real = p;
+ native = strcmp(path, p) == 0 ? real : strdup(path);
if (!native || !real)
goto error;