diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2019-06-04 11:32:58 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2019-06-06 09:34:17 +1000 |
commit | ad14e8e5085936bb495d15f4e0a1b653460ae4dd (patch) | |
tree | 585b98a4bc7f4ea901a48ecb6da057c42612df95 /apps/verify.c | |
parent | b1f692575411a400c9c9d4f2d1f0377863abaca5 (diff) |
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 <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9071)
Diffstat (limited to 'apps/verify.c')
-rw-r--r-- | apps/verify.c | 11 |
1 files changed, 10 insertions, 1 deletions
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); |