[PATCH 28/35] fs-tests: integck: fix memory leak in dir_new

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


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

Do not initialize dir->name because add_dir_entry already does
this for us, so we leak the memory.

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

diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index d2db320..666bc70 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -473,7 +473,6 @@ static int dir_new(struct dir_info *parent, const char *name)
 	free(path);
 
 	dir = zalloc(sizeof(struct dir_info));
-	dir->name = dup_string(name);
 	dir->parent = parent;
 	if (parent)
 		add_dir_entry(parent, 'd', name, dir);
-- 
1.7.2.3




More information about the linux-mtd mailing list