projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37a9051
)
file-posix: Don't leak fd in hdev_get_max_segments
author
Fam Zheng
<famz@redhat.com>
Tue, 14 Mar 2017 16:12:05 +0000
(
00:12
+0800)
committer
Kevin Wolf
<kwolf@redhat.com>
Fri, 17 Mar 2017 11:54:06 +0000
(12:54 +0100)
This fixes a leaked fd introduced in commit
9103f1ce
.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@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 ac6bd9fae8e08f4d9429f5db0d1cfc2d49f6b26d..53febd3767756141a7ab9e7954e57a1ba16aa336 100644
(file)
--- a/
block/file-posix.c
+++ b/
block/file-posix.c
@@
-703,6
+703,9
@@
static int hdev_get_max_segments(const struct stat *st)
}
out:
+ if (fd != -1) {
+ close(fd);
+ }
g_free(sysfspath);
return ret;
#else