Commit 4c1bd4e7 authored by Benjamin Dürholt's avatar Benjamin Dürholt

prevent segfault

parent 344264da
...@@ -109,6 +109,8 @@ struct rfbssl_ctx *rfbssl_init_global(char *key, char *cert) ...@@ -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_function(rfbssl_log_func);
gnutls_global_set_log_level(1); gnutls_global_set_log_level(1);
gnutls_certificate_set_dh_params(ctx->x509_cred, ctx->dh_params); 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; return ctx;
} }
......
...@@ -163,7 +163,11 @@ void rfbTightCleanup (rfbScreenInfoPtr screen) ...@@ -163,7 +163,11 @@ void rfbTightCleanup (rfbScreenInfoPtr screen)
tightAfterBufSize = 0; tightAfterBufSize = 0;
tightAfterBuf = NULL; tightAfterBuf = NULL;
} }
if (j) tjDestroy(j); if (j) {
tjDestroy(j);
//Set freed resource handle to 0!
j = 0;
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment