From: Pauli Date: Thu, 6 Aug 2020 01:11:44 +0000 (+1000) Subject: drbgtest: avoid a memory leak X-Git-Tag: openssl-3.0.0-alpha7~633 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64827f407b0b603f585d7fadfd7e61a60ed7a45b;p=thirdparty%2Fopenssl.git drbgtest: avoid a memory leak Reviewed-by: Matthias St. Pierre (Merged from https://github.com/openssl/openssl/pull/12509) --- diff --git a/test/drbgtest.c b/test/drbgtest.c index 2d72055cc7e..c6c8438e98d 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)