From owner-svn-src-head@freebsd.org Tue Sep 26 12:15:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 635DEE08F13; Tue, 26 Sep 2017 12:15:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA9063765; Tue, 26 Sep 2017 12:15:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8QCFDDM030811; Tue, 26 Sep 2017 12:15:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8QCFDg2030810; Tue, 26 Sep 2017 12:15:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201709261215.v8QCFDg2030810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Sep 2017 12:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324014 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 324014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 26 Sep 2017 12:15:14 -0000 Author: manu Date: Tue Sep 26 12:15:13 2017 New Revision: 324014 URL: https://svnweb.freebsd.org/changeset/base/324014 Log: mountd: Avoid memory leak by freeing dp_dirp Introduced in r324007, the data alloced by strdup was never free'ed. While here, remove cast to caddr_t when freeing dp. Reported by: bde MFC after: 1 week X MFC With: r324007 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Tue Sep 26 11:16:33 2017 (r324013) +++ head/usr.sbin/mountd/mountd.c Tue Sep 26 12:15:13 2017 (r324014) @@ -2159,7 +2159,8 @@ free_dir(struct dirlist *dp) free_dir(dp->dp_left); free_dir(dp->dp_right); free_host(dp->dp_hosts); - free((caddr_t)dp); + free(dp->dp_dirp); + free(dp); } }