mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
virLockDaemonPostExecRestart: Automatically free temporary variables
Convert two temp strings and one virJSONValue to g_auto(free|ptr). Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f24bc212ab
commit
bec4f09fff
@ -607,10 +607,10 @@ virLockDaemonPostExecRestart(const char *state_file,
|
|||||||
bool privileged)
|
bool privileged)
|
||||||
{
|
{
|
||||||
const char *gotmagic;
|
const char *gotmagic;
|
||||||
char *wantmagic = NULL;
|
g_autofree char *wantmagic = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
char *state = NULL;
|
g_autofree char *state = NULL;
|
||||||
virJSONValue *object = NULL;
|
g_autoptr(virJSONValue) object = NULL;
|
||||||
|
|
||||||
VIR_DEBUG("Running post-restart exec");
|
VIR_DEBUG("Running post-restart exec");
|
||||||
|
|
||||||
@ -660,9 +660,6 @@ virLockDaemonPostExecRestart(const char *state_file,
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
unlink(state_file);
|
unlink(state_file);
|
||||||
VIR_FREE(wantmagic);
|
|
||||||
VIR_FREE(state);
|
|
||||||
virJSONValueFree(object);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user