fix: add check for NULL zalloc in tls-provider.c (reverse if statement)

CLA: trivial

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26814)
This commit is contained in:
Burkov Egor 2025-02-18 12:49:07 +03:00 committed by Tomas Mraz
parent cab4e7cbd1
commit c5eb70de75

View file

@ -930,9 +930,10 @@ static void *xor_gen_init(void *provctx, int selection,
| OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)) == 0)
return NULL;
if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL)
gctx->selection = selection;
if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) == NULL)
return NULL;
gctx->selection = selection;
gctx->libctx = PROV_XOR_LIBCTX_OF(provctx);
if (!xor_gen_set_params(gctx, params)) {