From f34b095fab1569d093b639bfcc9a77d6020148ff Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Tue, 12 May 2015 11:49:32 -0400 Subject: Add NULL checks from master The big "don't check for NULL" cleanup requires backporting some of the lowest-level functions to actually do nothing if NULL is given. This will make it easier to backport fixes to release branches, where master assumes those lower-level functions are "safe" This commit addresses those tickets: 3798 3799 3801. Reviewed-by: Matt Caswell --- crypto/cmac/cmac.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crypto/cmac') diff --git a/crypto/cmac/cmac.c b/crypto/cmac/cmac.c index c5597a3f73..774e6dc919 100644 --- a/crypto/cmac/cmac.c +++ b/crypto/cmac/cmac.c @@ -126,6 +126,8 @@ EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx) void CMAC_CTX_free(CMAC_CTX *ctx) { + if (!ctx) + return; CMAC_CTX_cleanup(ctx); OPENSSL_free(ctx); } -- cgit v1.2.3