mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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:
committed by
Michael Tokarev
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);
|
||||
|
||||
Reference in New Issue
Block a user