[Spice-devel] [linux-vdagent PATCH v1] uinput: avoid double free

Victor Toso lists at victortoso.com
Tue Sep 15 00:16:22 PDT 2015


Hi,

On Tue, Sep 15, 2015 at 08:55:00AM +0200, Victor Toso wrote:
> commit 4835df0b642dfc963e7 fixed a leak but by not setting pointer to
> NULL it could lead to double free.
> 
> Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1262635
> ---
>  src/vdagentd-uinput.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/vdagentd-uinput.c b/src/vdagentd-uinput.c
> index 1ce9918..446c0ed 100644
> --- a/src/vdagentd-uinput.c
> +++ b/src/vdagentd-uinput.c
> @@ -77,8 +77,10 @@ void vdagentd_uinput_destroy(struct vdagentd_uinput **uinputp)
>      if (uinput->fd != -1)
>          close(uinput->fd);
>  
> -    if (uinput->screen_info != NULL)
> +    if (uinput->screen_info != NULL) {
>          free(uinput->screen_info);
> +        uinput->screen_info = NULL;
> +    }

This patch can be ignored!
More should come shortly...

Thanks Pavel.


More information about the Spice-devel mailing list