summaryrefslogtreecommitdiffstats
path: root/src/dirpart.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-08-18 08:50:30 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-08-18 08:50:30 +0200
commit727db32485358f99a795c52d26db582c828b9ab0 (patch)
tree9c72fb187bc268716c366e977e40ed11ec5cdc16 /src/dirpart.c
parentd7a1c2e18229160870dc98f5fcee63c9d0c72eff (diff)
Fix small memory leak when copying files
Diffstat (limited to 'src/dirpart.c')
-rw-r--r--src/dirpart.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dirpart.c b/src/dirpart.c
index a17f25d..9d596be 100644
--- a/src/dirpart.c
+++ b/src/dirpart.c
@@ -27,6 +27,9 @@
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#include "types.h"
#include "common.h"
#include "fat.h"
@@ -54,6 +57,7 @@ int dir_partition(disk_t *disk_car, const partition_t *partition, const int verb
#endif
int res=-3;
fflush(stderr);
+ dir_data.local_dir=NULL;
if(is_part_fat(partition))
res=dir_partition_fat_init(disk_car,partition,&dir_data,verbose);
else if(is_part_ntfs(partition))
@@ -187,5 +191,6 @@ int dir_partition(disk_t *disk_car, const partition_t *partition, const int verb
wrefresh(stdscr);
#endif
fflush(stderr);
+ free(dir_data.local_dir);
return res;
}