Check for NULL return from zalloc in dh_dupctx.
authorPauli <paul.dale@oracle.com>
Tue, 30 Jul 2019 21:19:33 +0000 (07:19 +1000)
committerPauli <paul.dale@oracle.com>
Wed, 31 Jul 2019 05:50:49 +0000 (15:50 +1000)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9485)

providers/common/exchange/dh_exch.c

index b4bfd5f419b226b7d9720df05f94c8c9efda34c4..62041daab3e2f29bab7d8ec48937c4f08886b6bd 100644 (file)
@@ -106,6 +106,8 @@ static void *dh_dupctx(void *vpdhctx)
     PROV_DH_CTX *dstctx;
 
     dstctx = OPENSSL_zalloc(sizeof(*srcctx));
+    if (dstctx == NULL)
+        return NULL;
 
     *dstctx = *srcctx;
     if (dstctx->dh != NULL && !DH_up_ref(dstctx->dh)) {