mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
hw/xen: Use g_free instead of free and fix potential memory leaks
The wrong functions and the missing calls of g_free were reported by cppcheck. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
1e2a1d41f2
commit
c5633d998a
2 changed files with 7 additions and 5 deletions
|
@ -1777,12 +1777,12 @@ static int xen_pt_config_reg_init(XenPCIPassthroughState *s,
|
|||
rc = reg->init(s, reg_entry->reg,
|
||||
reg_grp->base_offset + reg->offset, &data);
|
||||
if (rc < 0) {
|
||||
free(reg_entry);
|
||||
g_free(reg_entry);
|
||||
return rc;
|
||||
}
|
||||
if (data == XEN_PT_INVALID_REG) {
|
||||
/* free unused BAR register entry */
|
||||
free(reg_entry);
|
||||
g_free(reg_entry);
|
||||
return 0;
|
||||
}
|
||||
/* set register value */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue