From: Matt Coleman Date: Tue, 3 Nov 2020 00:22:01 +0000 (-0500) Subject: hyperv: g_autofree username and password in hypervConnectOpen() X-Git-Tag: v6.10.0-rc1~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5dadf9a715c8f1d45c94269968c3ceaeb7727fc;p=thirdparty%2Flibvirt.git hyperv: g_autofree username and password in hypervConnectOpen() Signed-off-by: Matt Coleman Reviewed-by: Neal Gompa Reviewed-by: Michal Privoznik --- 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; }