On 05/25/2017 04:20 AM, Yi Wang wrote:
> The @meminfo allocated in qemuMonitorGetMemoryDeviceInfo may be lost when
> exit monitor failed. Luckily we can free it according to rc.
>
> Signed-off-by: Yi Wang
> ---
> src/qemu/qemu_domain.c | 5 -
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index c8dc748..c34ec5a 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -5767,8 +5767,11 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr
> driver,
>
> rc = qemuMonitorGetMemoryDeviceInfo(priv->mon, );
>
> -if (qemuDomainObjExitMonitor(driver, vm) < 0)
> +if (qemuDomainObjExitMonitor(driver, vm) < 0) {
> +if (0 == rc)
We don't use this style in libvirt. Moreover, there's no real need for
the check as virHashFree() accepts NULL happily.
> +virHashFree(meminfo);
> return -1;
> +}
>
> /* if qemu doesn't support the info request, just carry on */
> if (rc == -2)
>
I've fixed that, ACKed and pushed.
Michal
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list