Commit ef3bfd7
committed
Fix memory leaks related to openssl EC pathways
This update fixes a few memory leaks associated with the creation of
EC private and public keys.
This openssl api BN_bn2bin described here:
https://www.openssl.org/docs/man1.0.2/man3/BN_bin2bn.html
This api states that a new BIGNUM is created if the last argument
is null to the API. In our case the last argument is indeed null
so we are leaking memory in the EC paths since we never free the big
number returned.
A cleanup goto was also added to simplify the code and ensure that
all cleanup of allocated memory is done. We make explicit calls
to then free all allocated memory in the cleanup.
This is a cherry pick of:
ibmruntimes/openj9-openjdk-jdk@969654a
Signed-off-by: Jason Katonica [email protected]1 parent 2fa3123 commit ef3bfd7
File tree
1 file changed
+265
-185
lines changed1 file changed
+265
-185
lines changed
0 commit comments