From: Matt Coleman Date: Thu, 21 Jan 2021 18:50:54 +0000 (-0500) Subject: hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByID X-Git-Tag: v7.1.0-rc1~487 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ce05af9f207c8a7c18290a57533e17fa244e696;p=thirdparty%2Flibvirt.git hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByID Signed-off-by: Matt Coleman Reviewed-by: Laine Stump --- diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 45463d120d..e5a62c728b 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -1654,16 +1654,13 @@ hypervDomainLookupByID(virConnectPtr conn, int id) { virDomainPtr domain = NULL; hypervPrivate *priv = conn->privateData; - Msvm_ComputerSystem *computerSystem = NULL; + g_autoptr(Msvm_ComputerSystem) computerSystem = NULL; if (hypervGetVirtualSystemByID(priv, id, &computerSystem) < 0) - goto cleanup; + return NULL; hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain); - cleanup: - hypervFreeObject((hypervObject *)computerSystem); - return domain; }