[PATCH 07/16] virLogDaemonPostExecRestart: Use automatic freeing for variables

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/logging/log_daemon.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index cc7889399b..a2a5b5f547 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -435,10 +435,10 @@ virLogDaemonPostExecRestart(const char *state_file,
                             virLogDaemonConfig *config)
 {
     const char *gotmagic;
-    char *wantmagic = NULL;
+    g_autofree char *wantmagic = NULL;
     int ret = -1;
-    char *state = NULL;
-    virJSONValue *object = NULL;
+    g_autofree char *state = NULL;
+    g_autoptr(virJSONValue) object = NULL;

     VIR_DEBUG("Running post-restart exec");

@@ -490,9 +490,6 @@ virLogDaemonPostExecRestart(const char *state_file,

  cleanup:
     unlink(state_file);
-    VIR_FREE(wantmagic);
-    VIR_FREE(state);
-    virJSONValueFree(object);
     return ret;
 }

-- 
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