[Spice-devel] [PATCH] dcc: remove possible dandling pointers

Frediano Ziglio fziglio at redhat.com
Wed Nov 25 06:21:29 PST 2015


> 
> Can we fix the typo in the subject though? dandling -> dangling
> 

Sorry, was already pushed.

I'll have to remind this I really thought spelling was right with d!

Frediano

> 
> On Tue, 2015-11-24 at 17:42 +0100, Pavel Grunt wrote:
> > On Tue, 2015-11-24 at 16:17 +0000, Frediano Ziglio wrote:
> > > Set pointers to NULL after releasing encoders.
> > > This to make sure no further access will occurs.
> > > 
> > It is not a harm,
> > 
> > Acked-by: Pavel Grunt <pgrunt at redhat.com>
> > 
> > > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > > ---
> > >  server/dcc-encoders.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c
> > > index 1eaa604..a373412 100644
> > > --- a/server/dcc-encoders.c
> > > +++ b/server/dcc-encoders.c
> > > @@ -409,12 +409,17 @@ void dcc_encoders_init(DisplayChannelClient *dcc)
> > >  void dcc_encoders_free(DisplayChannelClient *dcc)
> > >  {
> > >      quic_destroy(dcc->quic);
> > > +    dcc->quic = NULL;
> > >      lz_destroy(dcc->lz);
> > > +    dcc->lz = NULL;
> > >      jpeg_encoder_destroy(dcc->jpeg);
> > > +    dcc->jpeg = NULL;
> > >  #ifdef USE_LZ4
> > >      lz4_encoder_destroy(dcc->lz4);
> > > +    dcc->lz4 = NULL;
> > >  #endif
> > >      zlib_encoder_destroy(dcc->zlib);
> > > +    dcc->zlib = NULL;
> > >  }
> > >  
> > >  static void marshaller_compress_buf_free(uint8_t *data, void *opaque)
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list