[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [qemu-xen staging] file-posix: Fix leaked fd in raw_open_common() error path
commit a8c5cf27c945d392edd85b0b0c64cd5c52cae658 Author: Kevin Wolf <kwolf@xxxxxxxxxx> AuthorDate: Fri Jul 17 12:54:26 2020 +0200 Commit: Kevin Wolf <kwolf@xxxxxxxxxx> CommitDate: Fri Jul 17 14:20:57 2020 +0200 file-posix: Fix leaked fd in raw_open_common() error path Signed-off-by: Kevin Wolf <kwolf@xxxxxxxxxx> Message-Id: <20200717105426.51134-4-kwolf@xxxxxxxxxx> Reviewed-by: Max Reitz <mreitz@xxxxxxxxxx> Signed-off-by: Kevin Wolf <kwolf@xxxxxxxxxx> --- block/file-posix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 996e45ab95..8cc39a1ef6 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -773,6 +773,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, } ret = 0; fail: + if (ret < 0 && s->fd != -1) { + qemu_close(s->fd); + } if (filename && (bdrv_flags & BDRV_O_TEMPORARY)) { unlink(filename); } -- generated by git-patchbot for /home/xen/git/qemu-xen.git#staging
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |