From 3ee4e8cea72056ea56fdbfff8bb1b6daf2276933 Mon Sep 17 00:00:00 2001 From: David von Oheimb Date: Tue, 26 Dec 2017 19:33:04 +0100 Subject: [PATCH] Remove a bad 'goto end' and a few superfluous ones in apps/lib/apps.c Reviewed-by: Tomas Mraz Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/4940) --- apps/lib/apps.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/lib/apps.c b/apps/lib/apps.c index 80dafaf52d..e627057887 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -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) { -- 2.25.1