Signed-off-by: Matt Coleman <matt@xxxxxxxxx> --- src/hyperv/hyperv_driver.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index e5a62c728b..fe1ab1c52c 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -1671,18 +1671,15 @@ hypervDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) virDomainPtr domain = NULL; hypervPrivate *priv = conn->privateData; char uuid_string[VIR_UUID_STRING_BUFLEN]; - Msvm_ComputerSystem *computerSystem = NULL; + g_autoptr(Msvm_ComputerSystem) computerSystem = NULL; virUUIDFormat(uuid, uuid_string); if (hypervMsvmComputerSystemFromUUID(priv, uuid_string, &computerSystem) < 0) - goto cleanup; + return NULL; hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain); - cleanup: - hypervFreeObject((hypervObject *)computerSystem); - return domain; } -- 2.30.0