ecdsa_ossl: address coverity nit

BN_CTX_end() does not handle NULL input, so we must manually check
before calling from the cleanup handler.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6502)
This commit is contained in:
Benjamin Kaduk 2018-06-17 20:00:02 -05:00
parent 09fb65d5e4
commit 5295b99b56

View file

@ -336,7 +336,8 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
ECDSA_SIG_free(ret); ECDSA_SIG_free(ret);
ret = NULL; ret = NULL;
} }
BN_CTX_end(ctx); if (ctx != NULL)
BN_CTX_end(ctx);
BN_CTX_free(ctx); BN_CTX_free(ctx);
BN_clear_free(kinv); BN_clear_free(kinv);
return ret; return ret;