NULL tofree when it is freed to avoid double free.
NULL tofree when it is freed to avoid double free.

Make sure key is not NULL before freeing it.

openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl