Fix CRYPTO_clear_realloc() bug.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 21 Apr 2016 14:30:17 +0000 (15:30 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 21 Apr 2016 22:56:44 +0000 (23:56 +0100)
commit2ac7753c107e71bfdcaa08b18eb4e6683292be57
tree805139bf04a817d7e3f2f4a6ebea867f140708b3
parente38bd9489aa2c7d87105f388027ba5a84c9949f9
Fix CRYPTO_clear_realloc() bug.

If allocation in CRYPTO_clear_realloc() fails don't free up the original
buffer: this is consistent with the behaviour of realloc(3) and is expected
in other places in OpenSSL.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
crypto/mem.c