aboutsummaryrefslogtreecommitdiff
path: root/src/common/torgzip.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2009-09-28 16:37:01 +0200
committerSebastian Hahn <sebastian@torproject.org>2009-12-12 03:29:44 +0100
commit3807db001d71c51e53c1897ae067671f5b771f2f (patch)
tree6c6f648f072d24e7bbf554de12519b27cd9ef888 /src/common/torgzip.c
parent4afdb79051f7b1caba49877fb57be60bda9d4514 (diff)
downloadtor-3807db001d71c51e53c1897ae067671f5b771f2f.tar.gz
tor-3807db001d71c51e53c1897ae067671f5b771f2f.zip
*_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.
Diffstat (limited to 'src/common/torgzip.c')
-rw-r--r--src/common/torgzip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index 762f2e71bf..13e0c7fb7c 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -423,7 +423,8 @@ tor_zlib_process(tor_zlib_state_t *state,
void
tor_zlib_free(tor_zlib_state_t *state)
{
- tor_assert(state);
+ if (!state)
+ return;
if (state->compress)
deflateEnd(&state->stream);