mdadm/6000-Assemble-free-resources-in-load_devices.patch

29 lines
753 B
Diff
Raw Normal View History

2019-12-31 22:19:03 +08:00
From e4317882e4c87a121b721cdb22cf41cc830c379d Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Wed, 10 Apr 2019 21:31:46 +0800
Subject: [PATCH 1/6] Assemble: free resources in load_devices
Like other failure cases in load_devices, we need
to free those resources as well.
---
Assemble.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Assemble.c b/Assemble.c
index 23892a3..0264190 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;
}
--
2.19.1