Replace remaining uses of VIR_FREE with g_clear_pointer. Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx> --- tools/vsh.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index f4b555fb8b..1f384d4ea6 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 * -- 2.31.1