coverity 1462541 Dereference after null check
authorPauli <paul.dale@oracle.com>
Sun, 26 Apr 2020 22:01:28 +0000 (08:01 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 30 Apr 2020 10:21:16 +0000 (20:21 +1000)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)

crypto/ct/ct_sct_ctx.c

index 99e0c21154181daa0ec1e9195ca112eac7fc2719..ad7b6e6f93b2231f0c7a214b6a978729dfd49d04 100644 (file)
@@ -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) {