mirror of https://gitee.com/openkylin/qemu.git
loader: fix potential memory leak
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
ec609656fc
commit
ed2f3bc1fa
|
@ -914,10 +914,16 @@ int rom_add_file(const char *file, const char *fw_dir,
|
||||||
err:
|
err:
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
g_free(rom->data);
|
g_free(rom->data);
|
||||||
g_free(rom->path);
|
g_free(rom->path);
|
||||||
g_free(rom->name);
|
g_free(rom->name);
|
||||||
|
if (fw_dir) {
|
||||||
|
g_free(rom->fw_dir);
|
||||||
|
g_free(rom->fw_file);
|
||||||
|
}
|
||||||
g_free(rom);
|
g_free(rom);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue