When listing corrupted ext2/3/4 filesystem, fix handle leak.
This commit is contained in:
parent
903d732fb1
commit
ec4cff1149
1 changed files with 2 additions and 0 deletions
|
@ -302,6 +302,7 @@ static int ext2_copy(disk_t *disk_car, const partition_t *partition, dir_data_t
|
|||
if (ext2fs_read_inode(ls->current_fs, file->stat.st_ino, &inode)!=0)
|
||||
{
|
||||
free(new_file);
|
||||
fclose(f_out);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -309,6 +310,7 @@ static int ext2_copy(disk_t *disk_car, const partition_t *partition, dir_data_t
|
|||
if (retval) {
|
||||
log_error("Error while opening ext2 file %s\n", dir_data->current_directory);
|
||||
free(new_file);
|
||||
fclose(f_out);
|
||||
return -2;
|
||||
}
|
||||
while (1)
|
||||
|
|
Loading…
Reference in a new issue