Don't leak memory on destruction.
Reviewed by: marcel MFC after: 3 days
This commit is contained in:
parent
c8fa870982
commit
36066952e5
@ -240,6 +240,12 @@ g_part_bsd_create(struct g_part_table *basetable, struct g_part_parms *gpp)
|
||||
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;
|
||||
|
@ -486,6 +486,12 @@ g_part_gpt_create(struct g_part_table *basetable, struct g_part_parms *gpp)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user