summaryrefslogtreecommitdiff
path: root/crypto/openssl/apps/req.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/apps/req.c')
-rw-r--r--crypto/openssl/apps/req.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/crypto/openssl/apps/req.c b/crypto/openssl/apps/req.c
index f9d6fba1094da..a603907cd5af5 100644
--- a/crypto/openssl/apps/req.c
+++ b/crypto/openssl/apps/req.c
@@ -200,9 +200,12 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv)
*p = '\0';
/* Finally have a clean "key"; see if it's there [by attempt to add it]. */
- if ((p = (char *)lh_OPENSSL_STRING_insert(addexts, (OPENSSL_STRING*)kv))
- != NULL || lh_OPENSSL_STRING_error(addexts)) {
- OPENSSL_free(p != NULL ? p : kv);
+ p = (char *)lh_OPENSSL_STRING_insert(addexts, (OPENSSL_STRING*)kv);
+ if (p != NULL) {
+ OPENSSL_free(p);
+ return 1;
+ } else if (lh_OPENSSL_STRING_error(addexts)) {
+ OPENSSL_free(kv);
return -1;
}
@@ -435,12 +438,14 @@ int req_main(int argc, char **argv)
if (verbose)
BIO_printf(bio_err, "Using configuration from %s\n", template);
- req_conf = app_load_config(template);
+ if ((req_conf = app_load_config(template)) == NULL)
+ goto end;
if (addext_bio) {
if (verbose)
BIO_printf(bio_err,
"Using additional configuration from command line\n");
- addext_conf = app_load_config_bio(addext_bio, NULL);
+ if ((addext_conf = app_load_config_bio(addext_bio, NULL)) == NULL)
+ goto end;
}
if (template != default_config_file && !app_load_modules(req_conf))
goto end;