Commit a60c151a authored by Pascal Cuoq's avatar Pascal Cuoq Committed by Kurt Roeckx
Browse files

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: default avatarKurt Roeckx <kurt@roeckx.be>
Reviewed-by: default avatarViktor Dukhovni <openssl-users@dukhovni.org>
parent 00f5263b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3880,7 +3880,7 @@ int ssl3_new(SSL *s)

void ssl3_free(SSL *s)
{
    if (s == NULL)
    if (s == NULL || s->s3 == NULL)
        return;

    ssl3_cleanup_key_block(s);