match_metadata_desc(): Fix memory leak
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
7897de29b5
commit
62f5838f5b
|
@ -169,13 +169,14 @@ static void getinfo_mbr(struct supertype *st, struct mdinfo *info, char *map)
|
||||||
|
|
||||||
static struct supertype *match_metadata_desc(char *arg)
|
static struct supertype *match_metadata_desc(char *arg)
|
||||||
{
|
{
|
||||||
struct supertype *st = malloc(sizeof(*st));
|
struct supertype *st;
|
||||||
|
|
||||||
if (!st)
|
|
||||||
return st;
|
|
||||||
if (strcmp(arg, "mbr") != 0)
|
if (strcmp(arg, "mbr") != 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
st = malloc(sizeof(*st));
|
||||||
|
if (!st)
|
||||||
|
return st;
|
||||||
st->ss = &mbr;
|
st->ss = &mbr;
|
||||||
st->info = NULL;
|
st->info = NULL;
|
||||||
st->minor_version = 0;
|
st->minor_version = 0;
|
||||||
|
|
Loading…
Reference in New Issue