From: Matt Coleman Date: Thu, 21 Jan 2021 18:50:48 +0000 (-0500) Subject: hyperv: use g_autoptr for Win32_OperatingSystem in hypervConnectOpen X-Git-Tag: v7.1.0-rc1~493 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c603b7c028ef6e87cb9bed22424b47ec070daf0;p=thirdparty%2Flibvirt.git hyperv: use g_autoptr for Win32_OperatingSystem in hypervConnectOpen Signed-off-by: Matt Coleman Reviewed-by: Laine Stump --- diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 680d8b762b..830a3414c5 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -1357,7 +1357,7 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, hypervPrivate *priv = NULL; g_autofree char *username = NULL; g_autofree char *password = NULL; - Win32_OperatingSystem *os = NULL; + g_autoptr(Win32_OperatingSystem) os = NULL; virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -1421,7 +1421,6 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, result = VIR_DRV_OPEN_SUCCESS; cleanup: - hypervFreeObject((hypervObject *)os); hypervFreePrivate(&priv); return result;