]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Memory leak during Assembly
authorAdam Kwolek <adam.kwolek@intel.com>
Wed, 21 Sep 2011 01:55:15 +0000 (11:55 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 21 Sep 2011 01:55:15 +0000 (11:55 +1000)
For fdlist pointer allocated in assemble_container_content() function,
free() is never called. This patch fixes this memory leak.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c

index 25cfec1d2800e3915e304a68e9d3b8a01295cf47..66d2ee42c369be172764fe75c09d863e7401d457 100644 (file)
@@ -1584,6 +1584,7 @@ int assemble_container_content(struct supertype *st, int mdfd,
                                if (fdlist[spare] >= 0)
                                        close(fdlist[spare]);
                        }
+                       free(fdlist);
                        if (err) {
                                fprintf(stderr, Name ": Failed to restore critical"
                                        " section for reshape - sorry.\n");