[PATCH 1/8] hyperv: g_autofree username and password in hypervConnectOpen()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Matt Coleman <matt@xxxxxxxxx>
---
 src/hyperv/hyperv_driver.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index a71d0d6261..5344d75585 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -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;
 }
-- 
2.27.0





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux