[PATCH 27/35] fs-tests: integck: fix memory lead in dir_remove

Artem Bityutskiy dedekind1 at gmail.com
Wed Apr 20 06:19:00 EDT 2011


From: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>

When removing a directory and freeing corresponding 'dir_info' object -
do not forget to free directory name as well.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 tests/fs-tests/integrity/integck.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 79c1020..d2db320 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -517,6 +517,7 @@ static int dir_remove(struct dir_info *dir)
 	/* Remove entry from parent directory */
 	remove_dir_entry(dir->entry);
 	free(path);
+	free(dir->name);
 	free(dir);
 	return 0;
 }
-- 
1.7.2.3




More information about the linux-mtd mailing list