conf: domain: Remove checking of return value of virHashCreateFull

This module has last two direct checks whether the value returned by
virHashCreateFull is NULL. Remove them so that static analyzers don't
get the false idea that checking the value is necessary.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2020-01-28 13:40:24 +01:00
parent 50f7483a0d
commit 2a5ea0a0c1

View File

@ -1044,28 +1044,22 @@ virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSetPtr addrs,
if (VIR_ALLOC(addrs->zpciIds) < 0)
return -1;
if (!(addrs->zpciIds->uids = virHashCreateFull(10, NULL,
virZPCIAddrKeyCode,
virZPCIAddrKeyEqual,
virZPCIAddrKeyCopy,
virZPCIAddrKeyPrintHuman,
virZPCIAddrKeyFree)))
goto error;
addrs->zpciIds->uids = virHashCreateFull(10, NULL,
virZPCIAddrKeyCode,
virZPCIAddrKeyEqual,
virZPCIAddrKeyCopy,
virZPCIAddrKeyPrintHuman,
virZPCIAddrKeyFree);
if (!(addrs->zpciIds->fids = virHashCreateFull(10, NULL,
virZPCIAddrKeyCode,
virZPCIAddrKeyEqual,
virZPCIAddrKeyCopy,
virZPCIAddrKeyPrintHuman,
virZPCIAddrKeyFree)))
goto error;
addrs->zpciIds->fids = virHashCreateFull(10, NULL,
virZPCIAddrKeyCode,
virZPCIAddrKeyEqual,
virZPCIAddrKeyCopy,
virZPCIAddrKeyPrintHuman,
virZPCIAddrKeyFree);
}
return 0;
error:
virDomainPCIAddressSetExtensionFree(addrs);
return -1;
}