]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: remove three "Useless Assignments"
authorDaniel Stenberg <daniel@haxx.se>
Wed, 4 Dec 2024 06:17:43 +0000 (07:17 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 4 Dec 2024 07:29:24 +0000 (08:29 +0100)
Pointed out by CodeSonar

Closes #15679

lib/vtls/openssl.c

index d2021ebbdb658e7fe382fda04e676661c2bf8908..1b0e8dd5f0e867001868d49468673b82c7ef2697 100644 (file)
@@ -1203,14 +1203,12 @@ static int use_privatekey_blob(SSL_CTX *ctx, const struct curl_blob *blob,
                                    (void *)key_passwd);
   else if(type == SSL_FILETYPE_ASN1)
     pkey = d2i_PrivateKey_bio(in, NULL);
-  else {
-    ret = 0;
+  else
     goto end;
-  }
-  if(!pkey) {
-    ret = 0;
+
+  if(!pkey)
     goto end;
-  }
+
   ret = SSL_CTX_use_PrivateKey(ctx, pkey);
   EVP_PKEY_free(pkey);
 end:
@@ -1237,11 +1235,8 @@ use_certificate_chain_blob(SSL_CTX *ctx, const struct curl_blob *blob,
 
   x = PEM_read_bio_X509_AUX(in, NULL,
                             passwd_callback, (void *)key_passwd);
-
-  if(!x) {
-    ret = 0;
+  if(!x)
     goto end;
-  }
 
   ret = SSL_CTX_use_certificate(ctx, x);