virCHProcessUpdateInfo: Automatically free virJSONValue

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-01 09:26:27 +01:00
parent 8fe1d5d4c9
commit f3febf9718

View File

@ -121,15 +121,13 @@ virCHProcessUpdateConsole(virDomainObj *vm,
static int
virCHProcessUpdateInfo(virDomainObj *vm)
{
virJSONValue *info;
g_autoptr(virJSONValue) info = NULL;
virCHDomainObjPrivate *priv = vm->privateData;
if (virCHMonitorGetInfo(priv->monitor, &info) < 0)
return -1;
virCHProcessUpdateConsole(vm, info);
virJSONValueFree(info);
return 0;
}