Commit 0461b7ea authored by Matt Caswell's avatar Matt Caswell
Browse files

Don't leak X509_OBJECT in an error path



Swap the ordering of some code to avoid a leak in an error path.

Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
parent 6493e480
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -576,13 +576,13 @@ static int cert_status_cb(SSL *s, void *arg)
        BIO_puts(bio_err, "cert_status: Can't retrieve issuer certificate.\n");
        goto done;
    }
    req = OCSP_REQUEST_new();
    if (req == NULL)
        goto err;
    id = OCSP_cert_to_id(NULL, x, X509_OBJECT_get0_X509(obj));
    X509_OBJECT_free(obj);
    if (!id)
        goto err;
    req = OCSP_REQUEST_new();
    if (req == NULL)
        goto err;
    if (!OCSP_request_add0_id(req, id))
        goto err;
    id = NULL;