summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libvncserver/rfbssl_gnutls.c2
-rw-r--r--libvncserver/tight.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/libvncserver/rfbssl_gnutls.c b/libvncserver/rfbssl_gnutls.c
index cf60cdc..fb3a0e7 100644
--- a/libvncserver/rfbssl_gnutls.c
+++ b/libvncserver/rfbssl_gnutls.c
@@ -109,6 +109,8 @@ struct rfbssl_ctx *rfbssl_init_global(char *key, char *cert)
gnutls_global_set_log_function(rfbssl_log_func);
gnutls_global_set_log_level(1);
gnutls_certificate_set_dh_params(ctx->x509_cred, ctx->dh_params);
+ //newly allocated memory should be initialized, at least where it is important
+ ctx->peekstart = ctx->peeklen = 0;
return ctx;
}
diff --git a/libvncserver/tight.c b/libvncserver/tight.c
index 276a2e3..8eb7380 100644
--- a/libvncserver/tight.c
+++ b/libvncserver/tight.c
@@ -163,7 +163,11 @@ void rfbTightCleanup (rfbScreenInfoPtr screen)
tightAfterBufSize = 0;
tightAfterBuf = NULL;
}
- if (j) tjDestroy(j);
+ if (j) {
+ tjDestroy(j);
+ //Set freed resource handle to 0!
+ j = 0;
+ }
}