diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index cd1979bb4d9..9e7c9c02708 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -1273,6 +1273,7 @@ g_part_wither(struct g_geom *gp, int error) table = gp->softc; if (table != NULL) { + G_PART_DESTROY(table, NULL); while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { LIST_REMOVE(entry, gpe_entry); g_free(entry); diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c index 6cc6245ca74..c006c59938a 100644 --- a/sys/geom/part/g_part_mbr.c +++ b/sys/geom/part/g_part_mbr.c @@ -465,6 +465,7 @@ g_part_mbr_read(struct g_part_table *basetable, struct g_consumer *cp) basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + g_free(buf); return (0); } diff --git a/sys/geom/part/g_part_pc98.c b/sys/geom/part/g_part_pc98.c index ab83662a4f9..a4235d6a776 100644 --- a/sys/geom/part/g_part_pc98.c +++ b/sys/geom/part/g_part_pc98.c @@ -458,6 +458,7 @@ g_part_pc98_read(struct g_part_table *basetable, struct g_consumer *cp) basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; + g_free(buf); return (0); }