diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2009-09-28 16:37:01 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2009-12-12 03:29:44 +0100 |
commit | 3807db001d71c51e53c1897ae067671f5b771f2f (patch) | |
tree | 6c6f648f072d24e7bbf554de12519b27cd9ef888 /src/or/rephist.c | |
parent | 4afdb79051f7b1caba49877fb57be60bda9d4514 (diff) | |
download | tor-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/or/rephist.c')
-rw-r--r-- | src/or/rephist.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index 1ff9cde69f..78ceb5f0d7 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -2272,6 +2272,8 @@ static void hs_usage_general_period_related_observations_free( hs_usage_general_period_related_observations_t *s) { + if (!s) + return; rephist_total_alloc-=sizeof(hs_usage_general_period_related_observations_t); tor_free(s); } @@ -2281,6 +2283,8 @@ static void hs_usage_current_observation_period_free( hs_usage_current_observation_period_t *s) { + if (!s) + return; rephist_total_alloc -= sizeof(hs_usage_current_observation_period_t); tor_free(s); } |