mirror of https://gitee.com/openkylin/libvirt.git
virLogDaemonPostExecRestart: Use automatic freeing for variables
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
fe51612611
commit
8db183f6c7
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue