mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-02 04:29:38 +00:00
Fix memory leak on error.
Thanks to Shi Lei (Gear Team, Qihoo 360 Inc.) for reporting this bug. Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
b05f231cd9
commit
ea060e026d
@ -527,6 +527,9 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
|
|||||||
if (os.length > SSL_MAX_SID_CTX_LENGTH) {
|
if (os.length > SSL_MAX_SID_CTX_LENGTH) {
|
||||||
c.error = SSL_R_BAD_LENGTH;
|
c.error = SSL_R_BAD_LENGTH;
|
||||||
c.line = __LINE__;
|
c.line = __LINE__;
|
||||||
|
OPENSSL_free(os.data);
|
||||||
|
os.data = NULL;
|
||||||
|
os.length = 0;
|
||||||
goto err;
|
goto err;
|
||||||
} else {
|
} else {
|
||||||
ret->sid_ctx_length = os.length;
|
ret->sid_ctx_length = os.length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user