-/* ocsp_ht.c */
/*
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
* 2006.
OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline)
{
- OCSP_REQ_CTX *rctx = OPENSSL_malloc(sizeof(*rctx));
+ OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));
- if (!rctx)
+ if (rctx == NULL)
return NULL;
rctx->state = OHS_ERROR;
rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
rctx->mem = BIO_new(BIO_s_mem());
rctx->io = io;
- rctx->asn1_len = 0;
if (maxline > 0)
rctx->iobuflen = maxline;
else
rctx->iobuflen = OCSP_MAX_LINE_LEN;
rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
- if (!rctx->iobuf || !rctx->mem) {
+ if (rctx->iobuf == NULL || rctx->mem == NULL) {
OCSP_REQ_CTX_free(rctx);
return NULL;
}
OCSP_REQ_CTX *rctx = NULL;
rctx = OCSP_REQ_CTX_new(io, maxline);
- if (!rctx)
+ if (rctx == NULL)
return NULL;
if (!OCSP_REQ_CTX_http(rctx, "POST", path))
ctx = OCSP_sendreq_new(b, path, req, -1);
- if (!ctx)
+ if (ctx == NULL)
return NULL;
do {