Plug some resource leaks.
This commit is contained in:
parent
f74ea2f034
commit
3e464c3a7d
@ -48,12 +48,15 @@ boolean tls_connect(rdpTls* tls)
|
||||
|
||||
if (tls->ssl == NULL)
|
||||
{
|
||||
SSL_CTX_free(tls->ctx);
|
||||
printf("SSL_new failed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SSL_set_fd(tls->ssl, tls->sockfd) < 1)
|
||||
{
|
||||
SSL_free(tls->ssl);
|
||||
SSL_CTX_free(tls->ctx);
|
||||
printf("SSL_set_fd failed\n");
|
||||
return false;
|
||||
}
|
||||
@ -63,7 +66,11 @@ boolean tls_connect(rdpTls* tls)
|
||||
if (connection_status <= 0)
|
||||
{
|
||||
if (tls_print_error("SSL_connect", tls->ssl, connection_status))
|
||||
{
|
||||
SSL_free(tls->ssl);
|
||||
SSL_CTX_free(tls->ctx);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user