Skip to content
Snippets Groups Projects
Commit 2f223460 authored by Julien Boeuf's avatar Julien Boeuf
Browse files

Fixing errors found by clang static analysis.

parent dad14be4
No related branches found
No related tags found
No related merge requests found
...@@ -567,7 +567,8 @@ static tsi_result populate_ssl_context( ...@@ -567,7 +567,8 @@ static tsi_result populate_ssl_context(
EC_KEY* ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); EC_KEY* ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
if (!SSL_CTX_set_tmp_ecdh(context, ecdh)) { if (!SSL_CTX_set_tmp_ecdh(context, ecdh)) {
gpr_log(GPR_ERROR, "Could not set ephemeral ECDH key."); gpr_log(GPR_ERROR, "Could not set ephemeral ECDH key.");
result = TSI_INTERNAL_ERROR; EC_KEY_free(ecdh);
return TSI_INTERNAL_ERROR;
} }
SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE); SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE);
EC_KEY_free(ecdh); EC_KEY_free(ecdh);
...@@ -604,6 +605,7 @@ static tsi_result build_alpn_protocol_name_list( ...@@ -604,6 +605,7 @@ static tsi_result build_alpn_protocol_name_list(
unsigned char* current; unsigned char* current;
*protocol_name_list = NULL; *protocol_name_list = NULL;
*protocol_name_list_length = 0; *protocol_name_list_length = 0;
if (num_alpn_protocols == 0) return TSI_INVALID_ARGUMENT;
for (i = 0; i < num_alpn_protocols; i++) { for (i = 0; i < num_alpn_protocols; i++) {
if (alpn_protocols_lengths[i] == 0) { if (alpn_protocols_lengths[i] == 0) {
gpr_log(GPR_ERROR, "Invalid 0-length protocol name."); gpr_log(GPR_ERROR, "Invalid 0-length protocol name.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment