diff options
author | Karel Zak | 2011-03-30 23:52:56 +0200 |
---|---|---|
committer | Karel Zak | 2011-03-30 23:52:56 +0200 |
commit | 2b6bd96f2b9998d573a5241c9e299ff4dd14bd2a (patch) | |
tree | 8a9a8803180cce472126decae8368ba22ea323fc /shlibs/mount/src/cache.c | |
parent | libmount: add phelper= support (diff) | |
download | kernel-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.c | 4 |
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; |