]> www.infradead.org Git - mtd-utils.git/commitdiff
fs-tests: integck: remove symlinks memory leaks
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 18 Apr 2011 14:41:22 +0000 (17:41 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 22 Apr 2011 11:29:52 +0000 (14:29 +0300)
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

index 96937ffd43531c9b5fabb42d5ee9fd844eec97c2..94ffeb8008f585dec7f3a1db68e9756ae5d4e1ee 100644 (file)
@@ -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;
 }