[libvirt] [PATCH] conf: Fix memory leak caused by missing VIR_FREE for video resolution.

Jonathon Jongsma jjongsma at redhat.com
Fri Oct 18 13:03:18 UTC 2019


Thanks,

Reviewed-by: Jonathon Jongsma <jjongsma at redhat.com>


On Fri, 2019-10-18 at 00:15 -0300, jcfaracco at gmail.com wrote:
> From: Julio Faracco <jcfaracco at gmail.com>
> 
> Commit 72862797 introduced resolution settings for QEMU video
> drivers.
> It includes a new structure inside video definition. So, the code
> needs
> to clear pointer allocation for that structure into clear function
> virDomainVideoDefClear(). This commit adds this missing VIR_FREE().
> 
> Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
> ---
>  src/conf/domain_conf.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 88e93f6fb8..696a01043e 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -2850,6 +2850,7 @@ virDomainVideoDefClear(virDomainVideoDefPtr
> def)
>      if (def->accel)
>          VIR_FREE(def->accel->rendernode);
>      VIR_FREE(def->accel);
> +    VIR_FREE(def->res);
>      VIR_FREE(def->virtio);
>      if (def->driver)
>          VIR_FREE(def->driver->vhost_user_binary);




More information about the libvir-list mailing list