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:18:20 +0000 (22:18 +0100)
commit15ef80b5b12ddd1b9496ca6e1bbae78b2dfdda98
tree5bafd375ab922383dab541ee4b157b8b4d70ced6
parent174ec019c3eb37f552d781a1549cdbccb81627ae
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)
(cherry picked from commit 6dcba070a94b1ead92f3e327cf207a0b7db6596f)
crypto/x509/x_name.c