From 3807db001d71c51e53c1897ae067671f5b771f2f Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Mon, 28 Sep 2009 16:37:01 +0200 Subject: *_free functions now accept NULL Some *_free functions threw asserts when passed NULL. Now all of them accept NULL as input and perform no action when called that way. This gains us consistence for our free functions, and allows some code simplifications where an explicit null check is no longer necessary. --- src/common/aes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/common/aes.c') diff --git a/src/common/aes.c b/src/common/aes.c index e07665635..451c31f02 100644 --- a/src/common/aes.c +++ b/src/common/aes.c @@ -263,7 +263,8 @@ aes_set_key(aes_cnt_cipher_t *cipher, const char *key, int key_bits) void aes_free_cipher(aes_cnt_cipher_t *cipher) { - tor_assert(cipher); + if (!cipher) + return; #ifdef USE_OPENSSL_EVP EVP_CIPHER_CTX_cleanup(&cipher->key); #endif -- cgit v1.2.3