diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-03-21 14:40:57 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-03-21 14:40:57 +0000 |
commit | beb895083c4794c6134e05dc0fbf0a1a6b919b8e (patch) | |
tree | ee29ee052db3a9c306629387f82bc6fcd893e875 /fips/rand/fips_drbg_lib.c | |
parent | 2d1122b802d2a0dedd3cb1da4eaaf73f79cc9d5e (diff) |
Free DRBG context in self tests.
Diffstat (limited to 'fips/rand/fips_drbg_lib.c')
-rw-r--r-- | fips/rand/fips_drbg_lib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fips/rand/fips_drbg_lib.c b/fips/rand/fips_drbg_lib.c index 94bc36a31f..a015da1e41 100644 --- a/fips/rand/fips_drbg_lib.c +++ b/fips/rand/fips_drbg_lib.c @@ -112,7 +112,8 @@ DRBG_CTX *FIPS_drbg_new(int type, unsigned int flags) void FIPS_drbg_free(DRBG_CTX *dctx) { - dctx->uninstantiate(dctx); + if (dctx->uninstantiate) + dctx->uninstantiate(dctx); OPENSSL_cleanse(dctx, sizeof(DRBG_CTX)); OPENSSL_free(dctx); } @@ -388,8 +389,9 @@ int FIPS_drbg_uninstantiate(DRBG_CTX *dctx) { int rv; if (!dctx->uninstantiate) - return 1; - rv = dctx->uninstantiate(dctx); + rv = 1; + else + rv = dctx->uninstantiate(dctx); /* Although we'd like to cleanse here we can't because we have to * test the uninstantiate really zeroes the data. */ |