From c1ac66afdb2aaf9e2b0cd4b8cf91e3c72303eaa7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Wed, 22 Jun 2022 07:27:39 +0200 Subject: [PATCH] vmx: use g_autofree in virVMXParseSerial MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Ján Tomko Reviewed-by: Pavel Hrdina --- src/vmx/vmx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 282e9562e0..43ddee5bb6 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2895,13 +2895,13 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port, bool startConnected = false; char fileType_name[48] = ""; - char *fileType = NULL; + g_autofree char *fileType = NULL; char fileName_name[48] = ""; - char *fileName = NULL; + g_autofree char *fileName = NULL; char network_endPoint_name[48] = ""; - char *network_endPoint = NULL; + g_autofree char *network_endPoint = NULL; g_autoptr(virURI) parsedUri = NULL; @@ -3048,10 +3048,6 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port, g_clear_pointer(def, virDomainChrDefFree); } - VIR_FREE(fileType); - VIR_FREE(fileName); - VIR_FREE(network_endPoint); - return result; } -- 2.47.2