]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mount: fix path leak
authorSage Weil <sage.weil@dreamhost.com>
Sun, 21 Aug 2011 21:00:56 +0000 (14:00 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Sun, 21 Aug 2011 21:00:56 +0000 (14:00 -0700)
canonicalize_path() does not free/touch it's argument; no need to strdup()
here.

Coverity cid 39

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mount/mtab.c

index 3fbe6f564c9f3de9117b8d3ef1c3a40e100aed37..9b2c9237e1645079f83793e01a54ccfdebc274a4 100644 (file)
@@ -251,7 +251,7 @@ update_mtab_entry(const char *spec, const char *node, const char *type,
                opts = "rw";
 
        mnt.mnt_fsname = strdup(spec);
-       mnt.mnt_dir = canonicalize_path(strdup(node));
+       mnt.mnt_dir = canonicalize_path(node);
        mnt.mnt_type = strdup(type);
        mnt.mnt_opts = strdup(opts);
        mnt.mnt_freq = freq;