Fix for leaking memory in EllipticCurvePublicNumbers.public_key() (#3732)

* Test for leaking memory in EllipticCurvePublicNumbers.public_key()

* Fix the memory leak

As far as I can tell, from spelunking in the OpenSSL source (as you do), EC_KEY_set_public_key_affine_coordinates doesn't take ownership of "x" or "y". https://github.com/openssl/openssl/blob/master/crypto/ec/ecp_smpl.c#L362-L420 is the place in the source I found that actually uses "x" and "y".

* Unused imports
2 files changed