fuzz/fuzz_rand.c: Add check for OSSL_LIB_CTX_new

As the potential failure of the OPENSSL_zalloc(), the OSSL_LIB_CTX_new()
could return NULL.
Therefore, it should be better to check it and return error if fails in
order to guarantee the success of the initialization.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17738)
diff --git a/fuzz/fuzz_rand.c b/fuzz/fuzz_rand.c
index 5bd343d..d71dfd7 100644
--- a/fuzz/fuzz_rand.c
+++ b/fuzz/fuzz_rand.c
@@ -146,6 +146,8 @@
                                    const OSSL_DISPATCH **out, void **provctx)
 {
     *provctx = OSSL_LIB_CTX_new();
+    if (*provctx == NULL)
+        return 0;
     *out = fuzz_rand_method;
     return 1;
 }