From owner-svn-src-head@FreeBSD.ORG Fri Sep 2 17:12:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 287541065670; Fri, 2 Sep 2011 17:12:00 +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 1845A8FC0C; Fri, 2 Sep 2011 17:12:00 +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 p82HBxxp008503; Fri, 2 Sep 2011 17:11:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p82HBxSS008501; Fri, 2 Sep 2011 17:11:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201109021711.p82HBxSS008501@svn.freebsd.org> From: John Baldwin Date: Fri, 2 Sep 2011 17:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225341 - head/sbin/mount X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 17:12:00 -0000 Author: jhb Date: Fri Sep 2 17:11:59 2011 New Revision: 225341 URL: http://svn.freebsd.org/changeset/base/225341 Log: 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. Reported by: rank1seeker @ gmail Approved by: re (kib) MFC after: 1 week Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Fri Sep 2 17:06:50 2011 (r225340) +++ head/sbin/mount/mount.c Fri Sep 2 17:11:59 2011 (r225341) @@ -589,6 +589,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); } @@ -599,6 +602,8 @@ mountfs(const char *vfstype, const char } free(optbuf); + free(mountprog); + mountprog = NULL; if (verbose) { if (statfs(name, &sf) < 0) {