projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bca5283
)
file-posix: Fix leaked fd in raw_open_common() error path
author
Kevin Wolf
<kwolf@redhat.com>
Fri, 17 Jul 2020 10:54:26 +0000
(12:54 +0200)
committer
Kevin Wolf
<kwolf@redhat.com>
Fri, 17 Jul 2020 12:20:57 +0000
(14:20 +0200)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <
20200717105426
.51134-4-kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/file-posix.c
patch
|
blob
|
history
diff --git
a/block/file-posix.c
b/block/file-posix.c
index 996e45ab9556fe9e6bfeecfc974c7ccab659abf7..8cc39a1ef6185659fa99ad90ae3dd7224ad54397 100644
(file)
--- 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);
}