From owner-svn-src-stable-8@FreeBSD.ORG Mon Sep 19 16:28:37 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44275106566C; Mon, 19 Sep 2011 16:28:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33ABA8FC14; Mon, 19 Sep 2011 16:28:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JGSbKU087628; Mon, 19 Sep 2011 16:28:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JGSbDY087626; Mon, 19 Sep 2011 16:28:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201109191628.p8JGSbDY087626@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Sep 2011 16:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225674 - stable/8/sbin/mount X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 16:28:37 -0000 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) {