krb5kdf: Do not dereference NULL ctx when allocation fails
@@ -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;
}
