From a6488fd3a2d8dcc11fdb2445fe08094d8c67be6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 10 Aug 2021 17:09:30 +0200 Subject: [PATCH] vsh: use g_clear_pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace remaining uses of VIR_FREE with g_clear_pointer. Signed-off-by: Ján Tomko Reviewed-by: Peter Krempa --- tools/vsh.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index f55eb083f5..f9600bafba 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2253,10 +2253,7 @@ vshCloseLogFile(vshControl *ctl) g_strerror(errno)); } - if (ctl->logfile) { - VIR_FREE(ctl->logfile); - ctl->logfile = NULL; - } + g_clear_pointer(&ctl->logfile, g_free); } #ifndef WIN32 @@ -2852,8 +2849,8 @@ vshReadlineDeinit(vshControl *ctl) } } - VIR_FREE(ctl->historydir); - VIR_FREE(ctl->historyfile); + g_clear_pointer(&ctl->historydir, g_free); + g_clear_pointer(&ctl->historyfile, g_free); } char *