mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
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:
parent
5ff9e851cb
commit
5abf5949c1
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user