]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: remove bad `goto`s into other scope
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Sun, 16 Feb 2025 20:52:52 +0000 (21:52 +0100)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Mon, 17 Feb 2025 07:46:11 +0000 (08:46 +0100)
All the `goto` did in these cases was effectively `return 0`, so just
use that explicitly.

Closes https://github.com/curl/curl/pull/16356

lib/vtls/openssl.c

index 3e49a95534e95511f276fa2ce4d5e699bdd4c8d7..d5f55d7c4674550cb97f8f5619ab751bad007bcf 100644 (file)
@@ -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) {
@@ -1728,7 +1728,7 @@ fail:
           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) {