Commit 1cb437be authored by Rob Percival's avatar Rob Percival Committed by Rich Salz
Browse files

CT code now calls X509_free() after calling SSL_get_peer_certificate()



Without this, the peer certificate would never be deleted, resulting in
a memory leak.

Reviewed-by: default avatarEmilia Käsper <emilia@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 147e54a7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3941,6 +3941,7 @@ static int ct_extract_x509v3_extension_scts(SSL *s)
            ct_move_scts(&s->scts, scts, SCT_SOURCE_X509V3_EXTENSION);

        SCT_LIST_free(scts);
        X509_free(cert);
    }

    return scts_extracted;
@@ -4071,6 +4072,7 @@ int SSL_validate_ct(SSL *s)

end:
    CT_POLICY_EVAL_CTX_free(ctx);
    X509_free(cert);
    return ret;
}