From be62ec7782f11e6015eaa953859a4ea240c4ed8b Mon Sep 17 00:00:00 2001 From: miod <> Date: Sat, 12 Jul 2014 14:58:32 +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. --- src/lib/libcrypto/x509/x509_vfy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/x509') diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 9d7a7d1228..d894facd47 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.c,v 1.34 2014/07/11 12:52:41 miod Exp $ */ +/* $OpenBSD: x509_vfy.c,v 1.35 2014/07/12 14:58:32 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1979,6 +1979,9 @@ X509_STORE_CTX_new(void) void X509_STORE_CTX_free(X509_STORE_CTX *ctx) { + if (ctx == NULL) + return; + X509_STORE_CTX_cleanup(ctx); free(ctx); } -- cgit v1.2.3-55-g6feb