]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Fix a memory leak in OCSP handling
authorJouni Malinen <jouni@codeaurora.org>
Wed, 8 May 2019 18:08:53 +0000 (21:08 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 8 May 2019 18:08:53 +0000 (21:08 +0300)
If OCSP_resp_find_status() fails with the first OCSP_CERTID, the
generation of the second OCSP_CERTID ended up leaking memory. Fix this
by freeing the previously allocated OCSP_CERTID on that code path.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/crypto/tls_openssl.c

index e5a025996ee08ea30f80e01e935bf69f49231f77..bf24074215c3359aeb58e47a45b07da41b39aa08 100644 (file)
@@ -4666,6 +4666,7 @@ static int ocsp_resp_cb(SSL *s, void *arg)
        res = OCSP_resp_find_status(basic, id, &status, &reason, &produced_at,
                                    &this_update, &next_update);
        if (!res) {
+               OCSP_CERTID_free(id);
                id = OCSP_cert_to_id(NULL, conn->peer_cert, conn->peer_issuer);
                if (!id) {
                        wpa_printf(MSG_DEBUG,