krb5kdf: Do not dereference NULL ctx when allocation fails

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13953)
This commit is contained in:
Tomas Mraz 2019-11-13 11:04:08 +01:00 committed by Tomas Mraz
parent b897b353df
commit 5764c3522c

View File

@ -63,8 +63,10 @@ static void *krb5kdf_new(void *provctx)
if (!ossl_prov_is_running())
return NULL;
if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL)
if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) {
ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
return NULL;
}
ctx->provctx = provctx;
return ctx;
}