]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: free resources in load_devices
authorGuoqing Jiang <gqjiang@suse.com>
Mon, 27 Aug 2018 03:10:51 +0000 (11:10 +0800)
committerJes Sorensen <jsorensen@fb.com>
Thu, 27 Sep 2018 14:29:48 +0000 (10:29 -0400)
Like other failure cases in load_devices, we need
to free those resources as well.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Assemble.c

index 23892a3720accab176793279788775c3599c4e20..02641900420ce18210e66cca8a780da0984d1986 100644 (file)
@@ -594,6 +594,9 @@ static int load_devices(struct devs *devices, char *devmap,
                        if (strcmp(c->update, "ppl") == 0 &&
                            ident->bitmap_fd >= 0) {
                                pr_err("PPL is not compatible with bitmap\n");
+                               close(mdfd);
+                               free(devices);
+                               free(devmap);
                                return -1;
                        }