mirror of https://gitee.com/openkylin/qemu.git
kvm: Fix potential resource leak (missing fclose)
This leak was detected by cppcheck. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
7c30f65703
commit
90527d2a8b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue