]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix memory leak
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 1 Nov 2011 03:54:56 +0000 (14:54 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 1 Nov 2011 03:54:56 +0000 (14:54 +1100)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-gpt.c

index 6f852aa128ecd4df4a2cd3978adb0647cfac2502..b8c9aae9baeb7e1e0abaa2136bc0a0a5747a2daa 100644 (file)
@@ -179,8 +179,10 @@ static struct supertype *match_metadata_desc(char *arg)
 
        if (!st)
                return st;
-       if (strcmp(arg, "gpt") != 0)
+       if (strcmp(arg, "gpt") != 0) {
+               free(st);
                return NULL;
+       }
 
        st->ss = &gpt;
        st->info = NULL;