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

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

Comments

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

Patch

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