[Spice-devel] [PATCH spice-gtk] Clear cache and glz dictionnary on switch-host

Yonit Halperin yhalperi at redhat.com
Sun Apr 15 22:14:55 PDT 2012


Ack
On 04/15/2012 11:01 PM, Marc-André Lureau wrote:
> If we don't clear the glz dictionnary, this might lead to
> corrupted/invalid dictionnary and invalid memory allocation due
> unbounded increase of dictionnary size
> ---
>   gtk/spice-session.c |    8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/gtk/spice-session.c b/gtk/spice-session.c
> index d30d089..02b35f3 100644
> --- a/gtk/spice-session.c
> +++ b/gtk/spice-session.c
> @@ -1122,9 +1122,9 @@ gboolean spice_session_get_client_provided_socket(SpiceSession *session)
>   }
>
>   G_GNUC_INTERNAL
> -void spice_session_switching_disconnect(SpiceSession *session)
> +void spice_session_switching_disconnect(SpiceSession *self)
>   {
> -    SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(session);
> +    SpiceSessionPrivate *s = SPICE_SESSION_GET_PRIVATE(self);
>       struct channel *item;
>       RingItem *ring, *next;
>
> @@ -1141,6 +1141,10 @@ void spice_session_switching_disconnect(SpiceSession *session)
>       }
>
>       g_warn_if_fail(!ring_is_empty(&s->channels)); /* ring_get_length() == 1 */
> +
> +    spice_session_palettes_clear(self);
> +    spice_session_images_clear(self);
> +    glz_decoder_window_clear(s->glz_window);
>   }
>
>   G_GNUC_INTERNAL



More information about the Spice-devel mailing list