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:
Ján Tomko 2020-10-06 16:42:51 +02:00
parent a5d88ffe0a
commit 366682c5e3

View File

@ -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;
}