[PATCH] Manage.c: fix small memory leak

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

 



'avail' is dynamically allocated, so it should be freed.

Signed-off-by: Lukasz Dorau <lukasz.dorau@xxxxxxxxx>
---
 Manage.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Manage.c b/Manage.c
index afa9b42..910caa6 100644
--- a/Manage.c
+++ b/Manage.c
@@ -853,6 +853,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
 			}
 			array_failed = !enough(array->level, array->raid_disks,
 					       array->layout, 1, avail);
+			free(avail);
 		} else
 			array_failed = 0;
 		if (array_failed) {

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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