diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-12-04 15:09:18 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-08 14:47:19 -0500 |
commit | db024adc90069ce9961f3993aba1b7372f09d77a (patch) | |
tree | bf42a6612ab7f26e6886604ba08e924dca6a28c6 /src/or/rendcache.h | |
parent | 176ad729d9b1ddeccdb3e721b5ab1bf64646223f (diff) | |
download | tor-db024adc90069ce9961f3993aba1b7372f09d77a.tar.gz tor-db024adc90069ce9961f3993aba1b7372f09d77a.zip |
Switch to a safer FREE_AND_NULL implementation
This one only evaluates the input once, so it cannot mess up even if
there are side effects.
Diffstat (limited to 'src/or/rendcache.h')
-rw-r--r-- | src/or/rendcache.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/rendcache.h b/src/or/rendcache.h index 66b48e0320..c1e9207a95 100644 --- a/src/or/rendcache.h +++ b/src/or/rendcache.h @@ -94,11 +94,13 @@ STATIC void rend_cache_entry_free_(rend_cache_entry_t *e); #define rend_cache_entry_free(e) FREE_AND_NULL(rend_cache_entry, (e)) STATIC void rend_cache_failure_intro_entry_free_(rend_cache_failure_intro_t *entry); -#define rend_cache_failure_intro_entry_free(e) \ - FREE_AND_NULL(rend_cache_failure_intro_entry, (e)) +#define rend_cache_failure_intro_entry_free(e) \ + FREE_AND_NULL_UNMATCHED(rend_cache_failure_intro_t, \ + rend_cache_failure_intro_entry_free_, (e)) STATIC void rend_cache_failure_entry_free_(rend_cache_failure_t *entry); -#define rend_cache_failure_entry_free(e) \ - FREE_AND_NULL(rend_cache_failure_entry, (e)) +#define rend_cache_failure_entry_free(e) \ + FREE_AND_NULL_UNMATCHED(rend_cache_failure_t, \ + rend_cache_failure_entry_free_, (e)) STATIC int cache_failure_intro_lookup(const uint8_t *identity, const char *service_id, rend_cache_failure_intro_t |