]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
raid6check: Fix memory leaks detected by valgrind
authorBernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Tue, 18 Jun 2013 09:09:26 +0000 (11:09 +0200)
committerNeilBrown <neilb@suse.de>
Wed, 19 Jun 2013 00:03:44 +0000 (10:03 +1000)
==2389947== 24 bytes in 1 blocks are definitely lost in loss record 1 of 10
==2389947==    at 0x4C2B3F8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2389947==    by 0x408067: xmalloc (xmalloc.c:36)
==2389947==    by 0x401B19: check_stripes (raid6check.c:151)
==2389947==    by 0x4030C6: main (raid6check.c:521)
==2389947==
==2389947== 24 bytes in 1 blocks are definitely lost in loss record 2 of 10
==2389947==    at 0x4C2B3F8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2389947==    by 0x408067: xmalloc (xmalloc.c:36)
==2389947==    by 0x401B67: check_stripes (raid6check.c:155)
==2389947==    by 0x4030C6: main (raid6check.c:521)
==2389947==

Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
Signed-off-by: NeilBrown <neilb@suse.de>
raid6check.c

index f5aeee449f54df2249195adf919f53a3c901ec6c..17f74304883b1510afea9e6d6a7fb8a6ad830064 100644 (file)
@@ -325,9 +325,11 @@ exitCheck:
        free(stripe_buf);
        free(stripes);
        free(blocks);
+       free(block_index_for_slot);
        free(p);
        free(q);
        free(results);
+       free(sig);
 
        return err;
 }