Fix memory leak if getwd(".") failed

This commit is contained in:
Christophe Grenier 2018-03-17 17:40:01 +01:00
parent 20f1c4c1a8
commit d6d5654de5

View file

@ -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, &copy_ok, &copy_bad);