From: Pauli Date: Fri, 19 Mar 2021 00:19:18 +0000 (+1000) Subject: sm2: fix coverity 1467503: explicit null dereference X-Git-Tag: openssl-3.0.0-alpha14~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbe286a36efffacc846c9134c4f000f2a49355a0;p=thirdparty%2Fopenssl.git sm2: fix coverity 1467503: explicit null dereference Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14618) --- diff --git a/providers/implementations/signature/sm2sig.c b/providers/implementations/signature/sm2sig.c index 6fb0ff919b1..9016aefc029 100644 --- a/providers/implementations/signature/sm2sig.c +++ b/providers/implementations/signature/sm2sig.c @@ -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;