Don't leak memory from ERR_add_error_vdata()
authorMatt Caswell <matt@openssl.org>
Mon, 28 Jan 2019 17:17:59 +0000 (17:17 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 29 Jan 2019 11:08:18 +0000 (11:08 +0000)
commitfa6b1ee1115c1e5e3a8286d833dcbaa2c1ce2b77
tree94f5af6e1bb67d3e44a8bffbb2783ce4a154a1b8
parent6e826c471b7f0431391a4e9f9484f6ea2833774a
Don't leak memory from ERR_add_error_vdata()

If the call the ERR_set_error_data() in ERR_add_error_vdata() fails then
a mem leak can occur. This commit checks that we successfully added the
error data, and if not frees the buffer.

Fixes #8085

Reviewed-by: Paul Yang <yang.yang@baishancloud.com>
(Merged from https://github.com/openssl/openssl/pull/8105)
crypto/err/err.c