kvm: Fix potential resource leak (missing fclose)
PATCH 1/1 kvm: Fix potential resource leak (missing fclose)
This leak was detected by cppcheck.
Signed-off-by Stefan Weil <[email protected]>
--- hw/i386/kvm/pci-assign.c | 1 + 1 file changed, 1 insertion(+)
hw/i386/kvm/pci-assign.c +1 -0
@@ -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);
Signature · 1 line
1.7.10.4
Michael Tokarev
AppliedThanks, 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