summaryrefslogtreecommitdiff
path: root/src/or/rendcache.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-04 15:09:18 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-08 14:47:19 -0500
commitdb024adc90069ce9961f3993aba1b7372f09d77a (patch)
treebf42a6612ab7f26e6886604ba08e924dca6a28c6 /src/or/rendcache.h
parent176ad729d9b1ddeccdb3e721b5ab1bf64646223f (diff)
downloadtor-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.h10
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