summaryrefslogtreecommitdiffstats
path: root/src/dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-11-22 08:26:28 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2010-11-22 08:26:28 +0100
commitc32dfa4e43b312ba9089478918da3b0de6631435 (patch)
tree3fc1eb5585bc4ea4359f441e5e02ddfbe8df6cfe /src/dir.c
parent3072cedc43aca432433b5d48b60397beca6e9deb (diff)
Reduce memory usage during NTFS undelete
Diffstat (limited to 'src/dir.c')
-rw-r--r--src/dir.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dir.c b/src/dir.c
index c17d8eb..fc02082 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -269,6 +269,7 @@ void delete_list_file_info(struct td_list_head *list)
{
file_info_t *file_info;
file_info=td_list_entry(file_walker, file_info_t, list);
+ free(file_info->name);
td_list_del(file_walker);
free(file_info);
}
@@ -336,13 +337,13 @@ int filesort(const struct td_list_head *a, const struct td_list_head *b)
if(res)
return res;
/* . and .. must listed before the other directories */
- if((file_a->stat.st_mode&LINUX_S_IFDIR) && strcmp(file_a->name,".")==0)
+ if((file_a->stat.st_mode&LINUX_S_IFDIR) && strcmp(file_a->name, ".")==0)
return -1;
- if((file_a->stat.st_mode&LINUX_S_IFDIR) && strcmp(file_a->name,"..")==0 &&
- !strcmp(file_b->name,".")==0)
+ if((file_a->stat.st_mode&LINUX_S_IFDIR) && strcmp(file_a->name, "..")==0 &&
+ !strcmp(file_b->name, ".")==0)
return -1;
/* Files and directories are sorted by name */
- return strcmp(file_a->name,file_b->name);
+ return strcmp(file_a->name, file_b->name);
}
/*