diff options
author | Stefan Weil <sw@weilnetz.de> | 2013-06-10 22:36:22 +0200 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2013-06-11 23:45:44 +0400 |
commit | c5633d998a27502ad8cc10c2d46f91b02555ae7a (patch) | |
tree | 90d53eb52bd7fcf6965be534c43ba1aca464c3e0 /hw/xen | |
parent | 1e2a1d41f29adc8ae3013612c5a0114a87773773 (diff) | |
download | qemu-c5633d998a27502ad8cc10c2d46f91b02555ae7a.tar.gz qemu-c5633d998a27502ad8cc10c2d46f91b02555ae7a.tar.bz2 qemu-c5633d998a27502ad8cc10c2d46f91b02555ae7a.zip |
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>
Diffstat (limited to 'hw/xen')
-rw-r--r-- | hw/xen/xen_pt_config_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index 01872db5b7..8ccc2e4b9c 100644 --- a/hw/xen/xen_pt_config_init.c +++ b/hw/xen/xen_pt_config_init.c @@ -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 */ |