* [Qemu-devel] [PATCH] kvm: Fix potential resource leak (missing fclose)
@ 2013-06-16 11:37 Stefan Weil
2013-06-18 2:32 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2013-06-16 11:37 UTC (permalink / raw)
To: qemu-trivial; +Cc: Stefan Weil, qemu-devel
This leak was detected by cppcheck.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
hw/i386/kvm/pci-assign.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index ff85590..1fb7ad4 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -548,6 +548,7 @@ static int get_real_id(const char *devpath, const char *idname, uint16_t *val)
if (fscanf(f, "%li\n", &id) == 1) {
*val = id;
} else {
+ fclose(f);
return -1;
}
fclose(f);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-18 2:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-16 11:37 [Qemu-devel] [PATCH] kvm: Fix potential resource leak (missing fclose) Stefan Weil
2013-06-18 2:32 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
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).