From 51a9a47c19f3d9c5da197e2fd3ee985fe2cfaeac Mon Sep 17 00:00:00 2001 From: jsg <> Date: Thu, 17 Apr 2014 17:30:22 +0000 Subject: fix some of the leaks ok miod@ looks good deraadt@ --- src/lib/libcrypto/ocsp/ocsp_ht.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/ocsp') diff --git a/src/lib/libcrypto/ocsp/ocsp_ht.c b/src/lib/libcrypto/ocsp/ocsp_ht.c index 17b252d6a8..0fa23b027b 100644 --- a/src/lib/libcrypto/ocsp/ocsp_ht.c +++ b/src/lib/libcrypto/ocsp/ocsp_ht.c @@ -167,16 +167,24 @@ OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, else rctx->iobuflen = OCSP_MAX_LINE_LEN; rctx->iobuf = malloc(rctx->iobuflen); - if (!rctx->iobuf) + if (!rctx->iobuf) { + free(rctx); return 0; + } if (!path) path = "/"; - if (BIO_printf(rctx->mem, post_hdr, path) <= 0) + if (BIO_printf(rctx->mem, post_hdr, path) <= 0) { + free(rctx->iobuf); + free(rctx); return 0; + } - if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) + if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) { + free(rctx->iobuf); + free(rctx); return 0; + } return rctx; } -- cgit v1.2.3-55-g6feb