]> xenbits.xensource.com Git - libvirt.git/commitdiff
hyperv: use g_autoptr for Win32_OperatingSystem in hypervConnectOpen
authorMatt Coleman <mcoleman@datto.com>
Thu, 21 Jan 2021 18:50:48 +0000 (13:50 -0500)
committerLaine Stump <laine@redhat.com>
Fri, 22 Jan 2021 19:04:24 +0000 (14:04 -0500)
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/hyperv/hyperv_driver.c

index 680d8b762b9fba6d495c4d456903a8a9a9c2ae30..830a3414c58b3fcf32bf99fffc32327a174bcc54 100644 (file)
@@ -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;