]> err.no Git - util-linux/commitdiff
mount: fix memory leak
authorPetr Uzel <petr.uzel@suse.cz>
Fri, 18 Jun 2010 15:14:53 +0000 (17:14 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 30 Jun 2010 10:51:31 +0000 (12:51 +0200)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
mount/mount.c

index c31892b2d04e17059618e019746fea6065153116..b2e445a45a42f2be7d3a90ed376957bbcd7562cc 100644 (file)
@@ -1452,13 +1452,15 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
       /* Mount succeeded, report this (if verbose) and write mtab entry.  */
 
       if (!(mounttype & MS_PROPAGATION)) {
+             char *mtab_opts = fix_opts_string (flags & ~MS_NOMTAB, extra_opts, user);
              update_mtab_entry(loop ? loopfile : spec,
                        node,
                        types ? types : "unknown",
-                       fix_opts_string (flags & ~MS_NOMTAB, extra_opts, user),
+                       mtab_opts,
                        flags,
                        freq,
                        pass);
+             free (mtab_opts);
       }
 
       block_signals (SIG_UNBLOCK);