ch: check return value of virJSONValueArrayAppend

It only errors out when presented with a non-array, but we do check
it everywhere else.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko 2024-11-06 14:03:27 +01:00
parent da66bf53b0
commit e45313c031

View File

@ -1002,7 +1002,8 @@ virCHMonitorBuildRestoreJson(virDomainDef *vmdef,
return -1;
if (virJSONValueObjectAppendNumberInt(net_json, "num_fds", vmdef->nets[i]->driver.virtio.queues))
return -1;
virJSONValueArrayAppend(nets, &net_json);
if (virJSONValueArrayAppend(nets, &net_json) < 0)
return -1;
}
if (virJSONValueObjectAppend(restore_json, "net_fds", &nets))
return -1;