[Spice-devel] [PATCH] dcc: remove possible dandling pointers
Victor Toso
lists at victortoso.com
Tue Nov 24 08:39:24 PST 2015
Hi,
On Tue, Nov 24, 2015 at 04:17:36PM +0000, Frediano Ziglio wrote:
> Set pointers to NULL after releasing encoders.
> This to make sure no further access will occurs.
>
> 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)
> --
> 2.4.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
Looks good.
Acked-by: Victor Toso <victortoso at redhat.com>
More information about the Spice-devel
mailing list