Skip to content

Commit

Permalink
Merge pull request softhsm#516 from ansasaki/fix_crypto_factory_mem_leak
Browse files Browse the repository at this point in the history
Fix memory leak in OSSLCryptoFactory
  • Loading branch information
halderen authored Feb 5, 2020
2 parents 42738d0 + caec0c7 commit 2b9768a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/crypto/OSSLCryptoFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ OSSLCryptoFactory::~OSSLCryptoFactory()
}
#endif

// Finish the rd_rand engine
ENGINE_finish(rdrand_engine);
ENGINE_free(rdrand_engine);
rdrand_engine = NULL;

// Destroy the one-and-only RNG
delete rng;

Expand Down

0 comments on commit 2b9768a

Please sign in to comment.