[PATCH 31/35] fs-tests: integck: remove symlinks memory leaks

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


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

When we create a symlink we also allocate a symlink_info structure
and the target path name. But when we remove a symlink - we do not
delete that memory. This patch fixes the issue.

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

diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 96937ff..94ffeb8 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -1898,6 +1898,8 @@ static int symlink_remove(struct symlink_info *symlink)
 	}
 
 	remove_dir_entry(symlink->entry);
+	free(symlink->target_pathname);
+	free(symlink);
 	free(path);
 	return 0;
 }
-- 
1.7.2.3




More information about the linux-mtd mailing list