From 64827f407b0b603f585d7fadfd7e61a60ed7a45b Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 6 Aug 2020 11:11:44 +1000 Subject: [PATCH] drbgtest: avoid a memory leak Reviewed-by: Matthias St. Pierre (Merged from https://github.com/openssl/openssl/pull/12509) --- test/drbgtest.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/drbgtest.c b/test/drbgtest.c index 2d72055cc7..c6c8438e98 100644 --- a/test/drbgtest.c +++ b/test/drbgtest.c @@ -627,6 +627,13 @@ err: int setup_tests(void) { + /* + * TODO(3.0): figure out why and fix. + * Create the primary DRBG here to avoid a memory leak if it is done in + * the test cases. + */ + if (RAND_get0_primary(NULL) == NULL) + return 0; ADD_TEST(test_rand_drbg_reseed); ADD_TEST(test_rand_drbg_prediction_resistance); #if defined(OPENSSL_THREADS) -- 2.34.1