Fix X509_NAME decode for malloc failures.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 2 Oct 2016 14:21:29 +0000 (15:21 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 11 Oct 2016 21:09:31 +0000 (22:09 +0100)
commit6dcba070a94b1ead92f3e327cf207a0b7db6596f
tree875d3121c56ff3ea339eae7b69dd30dda5f2ff5e
parentbf78883d45bd717f2b777312fe77511096925ab7
Fix X509_NAME decode for malloc failures.

The original X509_NAME decode free code was buggy: this
could result in double free or leaks if a malloc failure
occurred.

Simplify and fix the logic.

Thanks to Guido Vranken for reporting this issue.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1691)
crypto/x509/x_name.c