>From 8307153207e20e218896adbb3ca9dfef63b0742c Mon Sep 17 00:00:00 2001 From: Anna Czarnowska <anna.czarnowska@xxxxxxxxx> Date: Thu, 17 Feb 2011 22:47:23 +0100 Subject: [PATCH 2/2] fix: memory leak in Create Cc: linux-raid@xxxxxxxxxxxxxxx, Williams, Dan J <dan.j.williams@xxxxxxxxx>, Ciechanowski, Ed <ed.ciechanowski@xxxxxxxxx> match_metadata_desc allocates memory for st which is not needed after validate_geometry fails Signed-off-by: Anna Czarnowska <anna.czarnowska@xxxxxxxxx> --- Create.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/Create.c b/Create.c index a0669fe..ccda07b 100644 --- a/Create.c +++ b/Create.c @@ -309,8 +309,10 @@ int Create(struct supertype *st, char *mddev, if (st && !st->ss->validate_geometry (st, level, layout, raiddisks, chunk, size*2, dname, &freesize, - verbose > 0)) + verbose > 0)) { + free(st); st = NULL; + } } if (!st) { -- 1.7.1 -- 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