diff options
author | jsg <> | 2014-04-17 17:30:22 +0000 |
---|---|---|
committer | jsg <> | 2014-04-17 17:30:22 +0000 |
commit | be0fb4329cddeefa911490f2b43cba7e095d4112 (patch) | |
tree | bfc5432e721864a2de1b829a3ef22ab023e4479c /src/lib/libcrypto/ocsp | |
parent | 4548a3c094321575d43f2a8cd16539acf62e7628 (diff) | |
download | openbsd-be0fb4329cddeefa911490f2b43cba7e095d4112.tar.gz openbsd-be0fb4329cddeefa911490f2b43cba7e095d4112.tar.bz2 openbsd-be0fb4329cddeefa911490f2b43cba7e095d4112.zip |
fix some of the leaks
ok miod@ looks good deraadt@
Diffstat (limited to 'src/lib/libcrypto/ocsp')
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_ht.c | 14 |
1 files changed, 11 insertions, 3 deletions
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, | |||
167 | else | 167 | else |
168 | rctx->iobuflen = OCSP_MAX_LINE_LEN; | 168 | rctx->iobuflen = OCSP_MAX_LINE_LEN; |
169 | rctx->iobuf = malloc(rctx->iobuflen); | 169 | rctx->iobuf = malloc(rctx->iobuflen); |
170 | if (!rctx->iobuf) | 170 | if (!rctx->iobuf) { |
171 | free(rctx); | ||
171 | return 0; | 172 | return 0; |
173 | } | ||
172 | if (!path) | 174 | if (!path) |
173 | path = "/"; | 175 | path = "/"; |
174 | 176 | ||
175 | if (BIO_printf(rctx->mem, post_hdr, path) <= 0) | 177 | if (BIO_printf(rctx->mem, post_hdr, path) <= 0) { |
178 | free(rctx->iobuf); | ||
179 | free(rctx); | ||
176 | return 0; | 180 | return 0; |
181 | } | ||
177 | 182 | ||
178 | if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) | 183 | if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) { |
184 | free(rctx->iobuf); | ||
185 | free(rctx); | ||
179 | return 0; | 186 | return 0; |
187 | } | ||
180 | 188 | ||
181 | return rctx; | 189 | return rctx; |
182 | } | 190 | } |