[libvirt PATCH 5/5] util: use g_auto in virNodeSuspendHelper

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

 



Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/util/virnodesuspend.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c
index c92232dfe9..e1167605ca 100644
--- a/src/util/virnodesuspend.c
+++ b/src/util/virnodesuspend.c
@@ -102,7 +102,7 @@ static int virNodeSuspendSetNodeWakeup(unsigned long long alarmTime)
  */
 static void virNodeSuspendHelper(void *cmdString)
 {
-    virCommand *suspendCmd = virCommandNew((const char *)cmdString);
+    g_autoptr(virCommand) suspendCmd = virCommandNew((const char *)cmdString);
 
     /*
      * Delay for sometime so that the function virNodeSuspend()
@@ -112,8 +112,6 @@ static void virNodeSuspendHelper(void *cmdString)
     if (virCommandRun(suspendCmd, NULL) < 0)
         VIR_WARN("Failed to suspend the host");
 
-    virCommandFree(suspendCmd);
-
     /*
      * Now that we have resumed from suspend or the suspend failed,
      * reset 'aboutToSuspend' flag.
-- 
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