From owner-svn-src-all@FreeBSD.ORG Mon Apr 20 16:31:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29DA29D3; Mon, 20 Apr 2015 16:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 18A7DC5E; Mon, 20 Apr 2015 16:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3KGVRNK031113; Mon, 20 Apr 2015 16:31:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3KGVRwo031112; Mon, 20 Apr 2015 16:31:27 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504201631.t3KGVRwo031112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Apr 2015 16:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281769 - head/sys/geom/uncompress X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2015 16:31:28 -0000 Author: pfg Date: Mon Apr 20 16:31:27 2015 New Revision: 281769 URL: https://svnweb.freebsd.org/changeset/base/281769 Log: g_uncompress_taste: prevent a double free. Found by: Clang Static Analyzer MFC after: 1 week Modified: head/sys/geom/uncompress/g_uncompress.c Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Mon Apr 20 16:23:59 2015 (r281768) +++ head/sys/geom/uncompress/g_uncompress.c Mon Apr 20 16:31:27 2015 (r281769) @@ -571,6 +571,7 @@ g_uncompress_taste(struct g_class *mp, s (buf+sizeof(struct cloop_header)))[i]); } free(buf, M_GEOM); + buf = NULL; DPRINTF(("%s: done reading offsets\n", gp->name)); mtx_init(&sc->last_mtx, "geom_uncompress cache", NULL, MTX_DEF); sc->last_blk = -1;