Memory leaks fix. There seems to be more in other parts of OpenSSL...