summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2019-11-06 11:16:17 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2019-11-06 11:16:17 +0000
commit64e8ff57ec01391a133a0bae8e76011aa1b9a939 (patch)
tree6836753648fd7c3415192c20799fd28c3654fa68
parent5ed960b7c8ecd86fcc91fff4066cbe4a9f17b806 (diff)
Check return value and remove unnecessary variable
- Check NCONF_new() return value - Remove unnecessary 'i' comments from jsing@
-rw-r--r--usr.bin/openssl/req.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/openssl/req.c b/usr.bin/openssl/req.c
index 29a47cbfed8..7bfb90d14b1 100644
--- a/usr.bin/openssl/req.c
+++ b/usr.bin/openssl/req.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: req.c,v 1.17 2019/11/06 10:35:40 inoguchi Exp $ */
+/* $OpenBSD: req.c,v 1.18 2019/11/06 11:16:16 inoguchi Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -416,9 +416,9 @@ req_main(int argc, char **argv)
if (verbose)
BIO_printf(bio_err, "Using configuration from %s\n", template);
- req_conf = NCONF_new(NULL);
- i = NCONF_load(req_conf, template, &errline);
- if (i == 0) {
+ if ((req_conf = NCONF_new(NULL)) == NULL)
+ goto end;
+ if(!NCONF_load(req_conf, template, &errline)) {
BIO_printf(bio_err, "error on line %ld of %s\n", errline, template);
goto end;
}
@@ -439,9 +439,9 @@ req_main(int argc, char **argv)
if (verbose)
BIO_printf(bio_err,
"Using additional configuration from command line\n");
- addext_conf = NCONF_new(NULL);
- i = NCONF_load_bio(addext_conf, addext_bio, &errline);
- if (i == 0) {
+ if ((addext_conf = NCONF_new(NULL)) == NULL)
+ goto end;
+ if (!NCONF_load_bio(addext_conf, addext_bio, &errline)) {
BIO_printf(bio_err,
"req: Error on line %ld of config input\n",
errline);