From 90527d2a8bb08ca5b4774eacfdd6b8fe9671c077 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 16 Jun 2013 13:37:25 +0200 Subject: kvm: Fix potential resource leak (missing fclose) This leak was detected by cppcheck. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- 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 ff855904ba..1fb7ad44ab 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); -- cgit v1.2.3