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

login
register
mail settings
Submitter Artem Bityutskiy
Date April 20, 2011, 10:19 a.m.
Message ID <1303294748-5492-32-git-send-email-dedekind1@gmail.com>
Download mbox | patch
Permalink /patch/92182/
State Accepted
Commit 4499ce3b223410d010380efa0bbbcb1c00722006
Headers show

Comments

Artem Bityutskiy - April 20, 2011, 10:19 a.m.
From: Artem Bityutskiy <Artem.Bityutskiy@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@nokia.com>
---
 tests/fs-tests/integrity/integck.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

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;
 }