Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Sep 2011 16:28:37 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r225674 - stable/8/sbin/mount
Message-ID:  <201109191628.p8JGSbDY087626@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Mon Sep 19 16:28:36 2011
New Revision: 225674
URL: http://svn.freebsd.org/changeset/base/225674

Log:
  MFC 225341:
  Clear the mountprog variable after each mountfs() call so that mountprog
  options don't leak over into subsequent mounts listed in /etc/fstab.
  While here, fix a memory leak in debug mode.

Modified:
  stable/8/sbin/mount/mount.c
Directory Properties:
  stable/8/sbin/mount/   (props changed)

Modified: stable/8/sbin/mount/mount.c
==============================================================================
--- stable/8/sbin/mount/mount.c	Mon Sep 19 16:25:37 2011	(r225673)
+++ stable/8/sbin/mount/mount.c	Mon Sep 19 16:28:36 2011	(r225674)
@@ -588,6 +588,9 @@ mountfs(const char *vfstype, const char 
 		for (i = 1; i < mnt_argv.c; i++)
 			(void)printf(" %s", mnt_argv.a[i]);
 		(void)printf("\n");
+		free(optbuf);
+		free(mountprog);
+		mountprog = NULL;
 		return (0);
 	}
 
@@ -598,6 +601,8 @@ mountfs(const char *vfstype, const char 
 	}
 
 	free(optbuf);
+	free(mountprog);
+	mountprog = NULL;
 
 	if (verbose) {
 		if (statfs(name, &sf) < 0) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109191628.p8JGSbDY087626>