qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] kvm: Fix potential resource leak (missing fclose)
  2013-06-16 11:37 [Qemu-devel] [PATCH] kvm: Fix potential resource leak (missing fclose) Stefan Weil
@ 2013-06-18  2:32 ` Michael Tokarev
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2013-06-18  2:32 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, qemu-devel

Thanks, applied all of the following:

 kvm: Fix potential resource leak (missing fclose)
 savevm: Fix potential memory leak
 audio: Replace static functions in header file by macros, remove GCC_ATTR
 libcacard: Fix cppcheck warning and remove unneeded code

to the trivial patch queue.

/mjt

^ permalink raw reply	[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).