Fix resource leak coverity 1443711. Free the allocated pointer on error.
Fix resource leak coverity 1443711.
Free the allocated pointer on error.

Reviewed-by: Richard Levitte <5fb523282dd7956571c80524edc2dccfa0bd8234@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8503)

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