From e18fb0875566f64efbece5410fedc80437864a1c Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 12 Jul 2014 14:58:33 +0000 Subject: 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. --- lib/libcrypto/ocsp/ocsp_ht.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libcrypto/ocsp') 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); -- cgit v1.2.3