[libvirt PATCH 5/5] vsh: use g_clear_pointer

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

 



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




[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