summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2015-11-21 12:02:50 +0000
committerFrediano Ziglio <fziglio@redhat.com>2015-11-24 17:00:18 +0000
commitca41ff2be08f36d712f829d8eaf44e33ae75b07b (patch)
tree4512068d910b05c50131d8345c6a6ab8e966312d
parentfcb57e686a2d946d7f193676ee070c3a6945d0a4 (diff)
dcc: remove possible dandling pointers
Set pointers to NULL after releasing encoders. This to make sure no further access will occurs. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
-rw-r--r--server/dcc-encoders.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c
index 1eaa6044..a3734121 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)