Check for NULL return from zalloc in dh_dupctx.

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9485)
This commit is contained in:
Pauli 2019-07-31 07:19:33 +10:00
parent c361297046
commit 02c163ea89

View file

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