diff options
author | Christophe Grenier <grenier@cgsecurity.org> | 2018-03-17 17:40:01 +0100 |
---|---|---|
committer | Christophe Grenier <grenier@cgsecurity.org> | 2018-03-17 17:40:01 +0100 |
commit | d6d5654de516eeff3d20fd1dc744825fd3d32bd4 (patch) | |
tree | ad23a89e3af1835a1d127e14528ca5a5e6eb3474 | |
parent | 20f1c4c1a8df0b8b98851c1cee7ae7f84b2be11c (diff) |
Fix memory leak if getwd(".") failed
-rw-r--r-- | src/dir.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -372,7 +372,10 @@ void dir_whole_partition_copy(disk_t *disk, const partition_t *partition, dir_da dst_directory[1]='\0'; #ifdef HAVE_GETCWD if(getcwd(dst_directory, 4096)==NULL) + { + free(dst_directory); return ; + } #endif dir_data->local_dir=dst_directory; dir_whole_partition_copy_aux(disk, partition, dir_data, inode, ©_ok, ©_bad); |