From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 21:54:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4BA71065670; Fri, 11 Jun 2010 21:54:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C304D8FC19; Fri, 11 Jun 2010 21:54:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BLs4wd000749; Fri, 11 Jun 2010 21:54:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BLs4lS000746; Fri, 11 Jun 2010 21:54:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112154.o5BLs4lS000746@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 21:54:04 +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: r209073 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 11 Jun 2010 21:54:04 -0000 Author: marius Date: Fri Jun 11 21:54:04 2010 New Revision: 209073 URL: http://svn.freebsd.org/changeset/base/209073 Log: MFC: r208746 Don't leak memory on destruction. Reviewed by: marcel Approved by: re (kib) Modified: stable/8/sys/geom/part/g_part_bsd.c stable/8/sys/geom/part/g_part_gpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/8/sys/geom/part/g_part_bsd.c Fri Jun 11 21:46:45 2010 (r209072) +++ stable/8/sys/geom/part/g_part_bsd.c Fri Jun 11 21:54:04 2010 (r209073) @@ -239,6 +239,12 @@ g_part_bsd_create(struct g_part_table *b static int g_part_bsd_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_bsd_table *table; + + table = (struct g_part_bsd_table *)basetable; + if (table->bbarea != NULL) + g_free(table->bbarea); + table->bbarea = NULL; /* Wipe the second sector to clear the partitioning. */ basetable->gpt_smhead |= 2; Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Fri Jun 11 21:46:45 2010 (r209072) +++ stable/8/sys/geom/part/g_part_gpt.c Fri Jun 11 21:54:04 2010 (r209073) @@ -462,6 +462,12 @@ g_part_gpt_create(struct g_part_table *b static int g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_gpt_table *table; + + table = (struct g_part_gpt_table *)basetable; + if (table->hdr != NULL) + g_free(table->hdr); + table->hdr = NULL; /* * Wipe the first 2 sectors as well as the last to clear the