mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-24 09:49:59 +03:00
qemu: fix memleaks in qemuBuildCommandLine
free boot_opts_str and boot_order_str both in normal and error paths. Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
This commit is contained in:
@ -9266,6 +9266,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
VIR_FREE(boot_opts_str);
|
VIR_FREE(boot_opts_str);
|
||||||
|
VIR_FREE(boot_order_str);
|
||||||
|
|
||||||
if (def->os.kernel)
|
if (def->os.kernel)
|
||||||
virCommandAddArgList(cmd, "-kernel", def->os.kernel, NULL);
|
virCommandAddArgList(cmd, "-kernel", def->os.kernel, NULL);
|
||||||
@ -10746,6 +10747,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(boot_order_str);
|
VIR_FREE(boot_order_str);
|
||||||
|
VIR_FREE(boot_opts_str);
|
||||||
virBufferFreeAndReset(&boot_buf);
|
virBufferFreeAndReset(&boot_buf);
|
||||||
virObjectUnref(cfg);
|
virObjectUnref(cfg);
|
||||||
/* free up any resources in the network driver
|
/* free up any resources in the network driver
|
||||||
|
Reference in New Issue
Block a user