x509: fix a dangling pointer
authorPauli <pauli@openssl.org>
Wed, 12 May 2021 04:22:52 +0000 (14:22 +1000)
committerPauli <pauli@openssl.org>
Thu, 13 May 2021 08:00:36 +0000 (18:00 +1000)
commit66ddc0759a435672f1c48b856a0968e7f6e35a82
tree991359e6066c85f4c292917facee4410e8005fdc
parentb1423d04cdcad9dbbe2da6e4751f0895112cc977
x509: fix a dangling pointer

If object was pointer was passed and an error occured the object was freed & the
pointer returned.  Fix this to NULL out the caller's pointer before returning.

Fixes #15115

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15238)
crypto/x509/x_x509.c