Fix faulty free
authorRichard Levitte <levitte@openssl.org>
Sun, 29 Jan 2017 07:52:02 +0000 (08:52 +0100)
committerRichard Levitte <levitte@openssl.org>
Sun, 29 Jan 2017 14:31:01 +0000 (15:31 +0100)
commitd85d3c993e322d3e4c3f00be2910faa8c55b40e3
tree563c5e2f6ffd792563613822d2a138d793c915ac
parent31b69e9a26c5b127ce273bc5834b9e13e5e25556
Fix faulty free

On error, i2o_SCT_signature() and i2o_SCT() free a pointer that may
have wandered off from the start of the allocated block (not currently
true for i2o_SCT_signature(), but has that potential as the code may
change.  To avoid this, save away the start of the allocated block and
free that instead.

Thanks to Guido Vranken for reporting this issue.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2323)
crypto/ct/ct_oct.c