sm2: fix coverity 1467503: explicit null dereference

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14618)
This commit is contained in:
Pauli 2021-03-19 10:19:18 +10:00 committed by Pauli
parent 993237a8b6
commit fbe286a36e

View File

@ -105,8 +105,8 @@ static void *sm2sig_newctx(void *provctx, const char *propq)
ctx->libctx = PROV_LIBCTX_OF(provctx);
if (propq != NULL && (ctx->propq = OPENSSL_strdup(propq)) == NULL) {
OPENSSL_free(ctx);
ctx = NULL;
ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
return NULL;
}
/* don't allow to change MD, and in fact there is no such need */
ctx->flag_allow_md = 0;