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:
Peter Krempa 2021-12-03 09:34:03 +01:00
parent fe51612611
commit 8db183f6c7

View File

@ -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;
}