mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
conf: virDomainUSBAddressHubNew: refactor
Remove the pointless variable and pointer stealing. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
a5d88ffe0a
commit
366682c5e3
@ -2028,7 +2028,7 @@ virDomainUSBAddressControllerModelToPorts(virDomainControllerDefPtr cont)
|
||||
static virDomainUSBAddressHubPtr
|
||||
virDomainUSBAddressHubNew(size_t nports)
|
||||
{
|
||||
virDomainUSBAddressHubPtr hub = NULL, ret = NULL;
|
||||
virDomainUSBAddressHubPtr hub;
|
||||
|
||||
hub = g_new0(virDomainUSBAddressHub, 1);
|
||||
|
||||
@ -2037,9 +2037,7 @@ virDomainUSBAddressHubNew(size_t nports)
|
||||
hub->ports = g_new0(virDomainUSBAddressHubPtr, nports);
|
||||
hub->nports = nports;
|
||||
|
||||
ret = g_steal_pointer(&hub);
|
||||
virDomainUSBAddressHubFree(hub);
|
||||
return ret;
|
||||
return hub;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user