Skip to content

Commit

Permalink
openssl: remove bad gotos into other scope
Browse files Browse the repository at this point in the history
All the `goto` did in these cases was effectively `return 0`, so just
use that explicitly.

Closes curl#16356
  • Loading branch information
MarcelRaad committed Feb 17, 2025
1 parent 4afe3e7 commit d164f49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/vtls/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ int cert_stuff(struct Curl_easy *data,
failf(data, "No cert found in the openssl store: %s",
ossl_strerror(ERR_get_error(), error_buffer,
sizeof(error_buffer)));
goto fail;
return 0;
}

if(SSL_CTX_use_certificate(ctx, cert) != 1) {
Expand Down Expand Up @@ -1728,7 +1728,7 @@ int cert_stuff(struct Curl_easy *data,
failf(data, "No private key found in the openssl store: %s",
ossl_strerror(ERR_get_error(), error_buffer,
sizeof(error_buffer)));
goto fail;
return 0;
}

if(SSL_CTX_use_PrivateKey(ctx, priv_key) != 1) {
Expand Down

0 comments on commit d164f49

Please sign in to comment.