From ad14e8e5085936bb495d15f4e0a1b653460ae4dd Mon Sep 17 00:00:00 2001 From: Shane Lontis Date: Tue, 4 Jun 2019 11:32:58 +1000 Subject: Coverity fixes covID 1445689 Resource leak (in error path) covID 1445318 Resource leak (in test - minor) covID 1443705 Unchecked return value (Needed if CRYPTO_atomic_add() was used) covID 1443691 Resource leak (in app - minor) Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/9071) --- apps/verify.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/verify.c b/apps/verify.c index 3767972a5e..fd407646f5 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -169,11 +169,20 @@ int verify_main(int argc, char **argv) v_verbose = 1; break; case OPT_SM2ID: - /* we assume the input is not a hex string */ + if (sm2_id != NULL) { + BIO_printf(bio_err, + "Use one of the options 'sm2-hex-id' or 'sm2-id' \n"); + goto end; + } sm2_id = (unsigned char *)opt_arg(); sm2_idlen = strlen((const char *)sm2_id); break; case OPT_SM2HEXID: + if (sm2_id != NULL) { + BIO_printf(bio_err, + "Use one of the options 'sm2-hex-id' or 'sm2-id' \n"); + goto end; + } /* try to parse the input as hex string first */ sm2_free = 1; sm2_id = OPENSSL_hexstr2buf(opt_arg(), (long *)&sm2_idlen); -- cgit v1.2.3