]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hyperv: g_autofree username and password in hypervConnectOpen()
authorMatt Coleman <mcoleman@datto.com>
Tue, 3 Nov 2020 00:22:01 +0000 (19:22 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 3 Nov 2020 10:24:47 +0000 (11:24 +0100)
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/hyperv/hyperv_driver.c

index a71d0d6261cf98fbdc763400fd30ac2a1f50671f..5344d755855af73885d445e67b3dacb2410081e5 100644 (file)
@@ -421,8 +421,8 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth,
 {
     virDrvOpenStatus result = VIR_DRV_OPEN_ERROR;
     hypervPrivate *priv = NULL;
-    char *username = NULL;
-    char *password = NULL;
+    g_autofree char *username = NULL;
+    g_autofree char *password = NULL;
 
     virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
 
@@ -472,8 +472,6 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth,
 
  cleanup:
     hypervFreePrivate(&priv);
-    VIR_FREE(username);
-    VIR_FREE(password);
 
     return result;
 }