[PATCH 1/2] Assemble: free resources in load_devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Like other failure cases in load_devices, we need
to free those resources as well.

Signed-off-by: Guoqing Jiang <gqjiang@xxxxxxxx>
---
 Assemble.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Assemble.c b/Assemble.c
index 23892a3720ac..02641900420c 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.13.6




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux