Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
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