From bd5f280091e7b9b2308b6f99a239653eb317ca7d Mon Sep 17 00:00:00 2001 From: Pauli Date: Mon, 27 Apr 2020 08:01:28 +1000 Subject: [PATCH] coverity 1462541 Dereference after null check Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11651) --- crypto/ct/ct_sct_ctx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/ct/ct_sct_ctx.c b/crypto/ct/ct_sct_ctx.c index 99e0c21154..ad7b6e6f93 100644 --- a/crypto/ct/ct_sct_ctx.c +++ b/crypto/ct/ct_sct_ctx.c @@ -24,8 +24,10 @@ SCT_CTX *SCT_CTX_new(OPENSSL_CTX *libctx, const char *propq) { SCT_CTX *sctx = OPENSSL_zalloc(sizeof(*sctx)); - if (sctx == NULL) + if (sctx == NULL) { CTerr(CT_F_SCT_CTX_NEW, ERR_R_MALLOC_FAILURE); + return NULL; + } sctx->libctx = libctx; if (propq != NULL) { -- 2.25.1