linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Manage.c: fix small memory leak
@ 2013-09-05  9:16 Lukasz Dorau
  2013-09-09 23:33 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Dorau @ 2013-09-05  9:16 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, pawel.baldysiak

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

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
---
 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) {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-09 23:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-05  9:16 [PATCH] Manage.c: fix small memory leak Lukasz Dorau
2013-09-09 23:33 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).