diff options
author | Pascal Cuoq <cuoq@trust-in-soft.com> | 2015-11-23 00:13:15 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2015-11-24 21:56:39 +0100 |
commit | 784934498fac88eaeff106e22bcab44c272e2cc9 (patch) | |
tree | e1083d536de4b18b2b3dcfe6dfa35a315947a36a /ssl | |
parent | 0b5f9ce37bd0e4030faf6af9e1b6356693239576 (diff) |
ssl3_free(): Return if it wasn't created
If somewhere in SSL_new() there is a memory allocation failure, ssl3_free() can
get called with s->s3 still being NULL.
Patch also provided by Willy Tarreau <wtarreau@haproxy.com>
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org>
(cherry picked from commit 3e7bd2ce0b16f8611298175d6dc7cb35ee06ea6d)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/s3_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index de917d3f83..f716d77c81 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2955,7 +2955,7 @@ int ssl3_new(SSL *s) void ssl3_free(SSL *s) { - if (s == NULL) + if (s == NULL || s->s3 == NULL) return; #ifdef TLSEXT_TYPE_opaque_prf_input |