summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2018-08-27 05:10:51 +0200
committerJes Sorensen <jsorensen@fb.com>2018-09-27 16:29:48 +0200
commitd8b0173894fb4810d861ce390e241216bdfaf325 (patch)
treee715aa0398518c0abaea8abd2e7561641d37cbb1
parentimsm: Avoid duplicate entries in --detail-platform (diff)
downloadmdadm-d8b0173894fb4810d861ce390e241216bdfaf325.tar.xz
mdadm-d8b0173894fb4810d861ce390e241216bdfaf325.zip
Assemble: free resources in load_devices
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>
-rw-r--r--Assemble.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Assemble.c b/Assemble.c
index 23892a37..02641900 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -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;
}