ch_monitor: Stop leaking json value objects

In virCHMonitorBuildKernelRelatedJson there are two cases of json
value objects being lost after the pointer being redefined. This
change removes the needless redefinition.

Signed-off-by: William Douglas <william.douglas@intel.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
William Douglas 2021-10-01 11:12:33 -07:00 committed by Laine Stump
parent 5ff9e851cb
commit 5abf5949c1

View File

@ -121,7 +121,6 @@ virCHMonitorBuildKernelRelatedJson(virJSONValue *content, virDomainDef *vmdef)
_("Kernel image path in this domain is not defined"));
goto cleanup;
} else {
kernel = virJSONValueNewObject();
if (virJSONValueObjectAppendString(kernel, "path", vmdef->os.kernel) < 0)
goto cleanup;
if (virJSONValueObjectAppend(content, "kernel", &kernel) < 0)
@ -136,7 +135,6 @@ virCHMonitorBuildKernelRelatedJson(virJSONValue *content, virDomainDef *vmdef)
}
if (vmdef->os.initrd != NULL) {
initramfs = virJSONValueNewObject();
if (virJSONValueObjectAppendString(initramfs, "path", vmdef->os.initrd) < 0)
goto cleanup;
if (virJSONValueObjectAppend(content, "initramfs", &initramfs) < 0)