qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments
@ 2017-03-14 15:43 Fam Zheng
  2017-03-14 15:50 ` Kevin Wolf
  2017-03-14 16:11 ` Eric Blake
  0 siblings, 2 replies; 7+ messages in thread
From: Fam Zheng @ 2017-03-14 15:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Kevin Wolf, Max Reitz, qemu-block

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/file-posix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/file-posix.c b/block/file-posix.c
index c4c0663..e6170f4 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -703,6 +703,7 @@ static int hdev_get_max_segments(const struct stat *st)
     }
 
 out:
+    close(fd);
     g_free(sysfspath);
     return ret;
 #else
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-14 16:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-14 15:43 [Qemu-devel] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments Fam Zheng
2017-03-14 15:50 ` Kevin Wolf
2017-03-14 16:11   ` Fam Zheng
2017-03-14 16:11 ` Eric Blake
2017-03-14 16:14   ` Eric Blake
2017-03-14 16:16     ` Eric Blake
2017-03-14 16:16   ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).