[Spice-devel] [PATCH] spice-widget-x11.c: Fix change color parameter 16 bits to 32 bits

Uri Lublin uril at redhat.com
Tue Nov 27 06:17:54 PST 2012


On 11/27/2012 02:48 PM, Matilde Yanez wrote:
> Hello,
>
> Issue description:
> Running remote-viewer with QXL and X11 display.
> In VM, windows clients, change color parameter  16bits to 32 bits
> involves a remote-viewer crash.
> "glibc detected free() invalid pointer type".
> The following patch resolves this issue.
>
>
> patch:
>
> diff --git a/tmp/spice-gtk-git-26-nov/gtk/spice-widget-x11.c
> b/gtk/spice-widget-x11.c
> index 05b8d56..10aeeb6 100644
> --- a/tmp/spice-gtk-git-26-nov/gtk/spice-widget-x11.c
> +++ b/gtk/spice-widget-x11.c
>
> @@ -200,8 +200,13 @@ void spicex_image_destroy(SpiceDisplay *display)
>               d->ximage->data = NULL;
>           XDestroyImage(d->ximage);
>           d->ximage = NULL;
> -        if (d->convert)
> -            d->data = 0;
> +        if(d->convert){
> +        	if(d->data){
> +        		d->data = 0;
This line means you do not free d->data, but leak it.
> +        		g_free(d->data);
> +        		d->data = NULL;
> +        	}
> +        }
>       }
>



More information about the Spice-devel mailing list