Merge pull request #420 from pjd/fixes

Fix for storing fingerprints in known_hosts file and some resource leaks fixes.
This commit is contained in:
Marc-André Moreau 2012-02-12 09:13:03 -08:00
commit 657e6c6a55
2 changed files with 8 additions and 1 deletions

View File

@ -664,7 +664,7 @@ void certificate_data_print(rdpCertificateStore* certificate_store, rdpCertifica
if (!fp)
return;
fprintf(certificate_store->fp,"%s %s\n", certificate_data->hostname, certificate_data->fingerprint);
fprintf(fp, "%s %s\n", certificate_data->hostname, certificate_data->fingerprint);
fclose(fp);
}

View File

@ -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;