[Spice-devel] [PATCH v2 2/9] worker: do not leak cursor after disconnecting clients

Frediano Ziglio fziglio at redhat.com
Tue Jan 26 02:42:40 PST 2016


> 
> Hi,
> 
> On Tue, 2016-01-26 at 09:44 +0000, Frediano Ziglio wrote:
> > This also prevents future use of a NULL pointer.
> > 
> Can this happen now? Is it related to the PATCH 5/9 - function
> cursor_is_connected() ?
> 
> Pavel
> 

No, is not related.
Calling cursor_channel_disconnect does not free cursor_channel
so you have a leak.
Is the only location where the this pointer is reset basically
preventing any further cursor channel connection.
Basically if a client is lazy reading cursor data connection is closed
and further client won't be able to use the cursor.

Comment to me: perhaps these comments should be in the log... I'll do it.

Frediano


> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  server/red-worker.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/server/red-worker.c b/server/red-worker.c
> > index 9a392ec..dd293f7 100644
> > --- a/server/red-worker.c
> > +++ b/server/red-worker.c
> > @@ -455,7 +455,6 @@ static void flush_cursor_commands(RedWorker
> > *worker)
> >              if (spice_get_monotonic_time_ns() >= end_time) {
> >                  spice_warning("flush cursor timeout");
> >                  cursor_channel_disconnect(worker->cursor_channel);
> > -                worker->cursor_channel = NULL;
> >              } else {
> >                  sleep_count++;
> >                  usleep(DISPLAY_CLIENT_RETRY_INTERVAL);
> 


More information about the Spice-devel mailing list