Remove a bad 'goto end' and a few superfluous ones in apps/lib/apps.c
authorDavid von Oheimb <David.von.Oheimb@siemens.com>
Tue, 26 Dec 2017 18:33:04 +0000 (19:33 +0100)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Fri, 24 Apr 2020 16:00:24 +0000 (18:00 +0200)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/4940)

apps/lib/apps.c

index 80dafaf52d037b91081136f54b5917331755ebe3..e6270578879a0dee67040b739a04d6c242a7ebb6 100644 (file)
@@ -488,7 +488,6 @@ X509 *load_cert(const char *file, int format, const char *desc)
                                    OPT_FMT_HTTP |
 #endif
                                    OPT_FMT_PEMDER | OPT_FMT_PKCS12);
-        goto end;
     }
 
  end:
@@ -519,16 +518,13 @@ X509_CRL *load_crl(const char *infile, int format, const char *desc)
         x = d2i_X509_CRL_bio(in, NULL);
     } else if (format == FORMAT_PEM) {
         x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
-    } else {
+    } else
         print_format_error(format, OPT_FMT_PEMDER);
-        goto end;
-    }
 
  end:
     if (x == NULL && desc != NULL) {
         BIO_printf(bio_err, "unable to load %s\n", desc);
         ERR_print_errors(bio_err);
-        goto end;
     }
     BIO_free(in);
     return x;
@@ -547,10 +543,8 @@ X509_REQ *load_csr(const char *file, int format, const char *desc)
         req = d2i_X509_REQ_bio(in, NULL);
     else if (format == FORMAT_PEM)
         req = PEM_read_bio_X509_REQ(in, NULL, NULL, NULL);
-    else {
+    else
         print_format_error(format, OPT_FMT_PEMDER);
-        goto end;
-    }
 
  end:
     if (req == NULL && desc != NULL) {
@@ -628,8 +622,8 @@ EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
                                  | OPT_FMT_ENGINE
 #endif
                            );
-        goto end;
     }
+
  end:
     BIO_free(key);
     if (pkey == NULL && desc != NULL) {