diff options
author | Pauli <paul.dale@oracle.com> | 2020-08-06 03:11:44 +0200 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-08-07 06:16:47 +0200 |
commit | 64827f407b0b603f585d7fadfd7e61a60ed7a45b (patch) | |
tree | 7f4f9e27a1c9dee1aeeb202756f5022d1b30f04f /test/drbgtest.c | |
parent | rand_drbg: remove RAND_DRBG. (diff) | |
download | openssl-64827f407b0b603f585d7fadfd7e61a60ed7a45b.tar.xz openssl-64827f407b0b603f585d7fadfd7e61a60ed7a45b.zip |
drbgtest: avoid a memory leak
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/12509)
Diffstat (limited to 'test/drbgtest.c')
-rw-r--r-- | test/drbgtest.c | 7 |
1 files changed, 7 insertions, 0 deletions
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) |