Convert two temp strings and one virJSONValue to g_auto(free|ptr).
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/locking/lock_daemon.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index fc714052be..1edd912c3e 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -607,10 +607,10 @@ virLockDaemonPostExecRestart(const char *state_file,
bool privileged)
{
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");
@@ -660,9 +660,6 @@ virLockDaemonPostExecRestart(const char *state_file,
cleanup:
unlink(state_file);
- VIR_FREE(wantmagic);
- VIR_FREE(state);
- virJSONValueFree(object);
return ret;
}
--
2.31.1