summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ocsp
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-07-12 14:58:33 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-07-12 14:58:33 +0000
commite18fb0875566f64efbece5410fedc80437864a1c (patch)
treeee78433702a603369497958929eb246559dfe7f6 /lib/libcrypto/ocsp
parent356662dda25d42933a8f4c29cc13d71599448bfb (diff)
Principle of least surprise: make CMAC_CTX_free(), OCSP_REQ_CTX_free() and
X509_STORE_CTX_free() accept NULL pointers as input without dereferencing them, like all the other well-behaved *_CTX_free() functions do.
Diffstat (limited to 'lib/libcrypto/ocsp')
-rw-r--r--lib/libcrypto/ocsp/ocsp_ht.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libcrypto/ocsp/ocsp_ht.c b/lib/libcrypto/ocsp/ocsp_ht.c
index bc3c957b0cb..c895e9df4db 100644
--- a/lib/libcrypto/ocsp/ocsp_ht.c
+++ b/lib/libcrypto/ocsp/ocsp_ht.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ocsp_ht.c,v 1.19 2014/06/12 15:49:30 deraadt Exp $ */
+/* $OpenBSD: ocsp_ht.c,v 1.20 2014/07/12 14:58:32 miod Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
@@ -108,6 +108,9 @@ static int parse_http_line1(char *line);
void
OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)
{
+ if (rctx == NULL)
+ return;
+
if (rctx->mem)
BIO_free(rctx->mem);
free(rctx->iobuf);