From owner-svn-src-stable@freebsd.org Mon Nov 9 08:05:16 2015 Return-Path: Delivered-To: svn-src-stable@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 A2850A29B47; Mon, 9 Nov 2015 08:05:16 +0000 (UTC) (envelope-from ngie@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 6F14B1072; Mon, 9 Nov 2015 08:05:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA985F5N093319; Mon, 9 Nov 2015 08:05:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA985FnO093318; Mon, 9 Nov 2015 08:05:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090805.tA985FnO093318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 08:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290588 - stable/9/usr.sbin/makefs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 08:05:16 -0000 Author: ngie Date: Mon Nov 9 08:05:15 2015 New Revision: 290588 URL: https://svnweb.freebsd.org/changeset/base/290588 Log: MFstable/10 r290587: MFC r289687,r289693: r289687: Free buffer before returning from cd9660_write_path_table to avoid leaking it after returning from the function PR: 203647 Submitted by: Thomas Schmitt Coverity CID: 978431 Sponsored by: EMC / Isilon Storage Division r289693: Unbreak makefs -t cd9660 after r289687 buffer_head needs to be freed -- not buffer Detected by jemalloc, i.e. running makefs failed the arena assert because my copy of malloc on CURRENT is compiled with the default !MALLOC_PRODUCTION asserts on Pointyhat to: ngie PR: 203647 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:03:15 2015 (r290587) +++ stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:05:15 2015 (r290588) @@ -165,7 +165,7 @@ cd9660_write_path_table(FILE *fd, off_t diskStructure.pathTableLength); unsigned char *buffer; unsigned char *buffer_head; - int len; + int len, ret; path_table_entry temp_entry; cd9660node *ptcur; @@ -213,8 +213,10 @@ cd9660_write_path_table(FILE *fd, off_t ptcur = ptcur->ptnext; } - return cd9660_write_filedata(fd, sector, buffer_head, + ret = cd9660_write_filedata(fd, sector, buffer_head, path_table_sectors); + free(buffer_head); + return ret; }