use-after-free on failing RSA_generate_key_ex()
Reported by Yuan Kang.
When we generate a key, if openssl fails to generate an RSA key, we currently retain a dangling pointer to the previous (uninitialized) key value. The impact here should be limited to a difficult-to-trigger crash, if OpenSSL is running an engine that makes key generation failures possible, or if OpenSSL runs out of memory.