'hub' doesn't need to be freed any more because it's always consumed and NULLed-out by VIR_APPEND element. This also makes the 'ret' variable obsolete. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_domain_address.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 40e84cce9c..392368bd38 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2942,7 +2942,6 @@ qemuDomainUSBAddressAddHubs(virDomainDef *def) virDomainHubDef *hub = NULL; size_t available_ports; size_t hubs_needed = 0; - int ret = -1; size_t i; available_ports = virDomainUSBAddressCountAllPorts(def); @@ -2972,9 +2971,7 @@ qemuDomainUSBAddressAddHubs(virDomainDef *def) VIR_APPEND_ELEMENT(def->hubs, def->nhubs, hub); } - ret = 0; - VIR_FREE(hub); - return ret; + return 0; } -- 2.31.1