From ec4cff114933c32bcf2aa99eccbfd631ca0f2e81 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sun, 3 Apr 2011 17:47:50 +0200 Subject: [PATCH] When listing corrupted ext2/3/4 filesystem, fix handle leak. --- src/ext2_dir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ext2_dir.c b/src/ext2_dir.c index 92d244fe..02c04232 100644 --- a/src/ext2_dir.c +++ b/src/ext2_dir.c @@ -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)