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/hs_service.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/hs_service.h')
-rw-r--r-- | src/or/hs_service.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/hs_service.h b/src/or/hs_service.h index b759030166..f933ba6ab1 100644 --- a/src/or/hs_service.h +++ b/src/or/hs_service.h @@ -295,8 +295,9 @@ STATIC hs_service_intro_point_t *service_intro_point_new( const extend_info_t *ei, unsigned int is_legacy); STATIC void service_intro_point_free_(hs_service_intro_point_t *ip); -#define service_intro_point_free(ip) \ - FREE_AND_NULL(service_intro_point, (ip)) +#define service_intro_point_free(ip) \ + FREE_AND_NULL_UNMATCHED(hs_service_intro_point_t, \ + service_intro_point_free_, (ip)) STATIC void service_intro_point_add(digest256map_t *map, hs_service_intro_point_t *ip); STATIC void service_intro_point_remove(const hs_service_t *service, @@ -330,7 +331,9 @@ STATIC char * encode_desc_rev_counter_for_state(const hs_service_descriptor_t *desc); STATIC void service_descriptor_free_(hs_service_descriptor_t *desc); -#define service_descriptor_free(d) FREE_AND_NULL(service_descriptor, (d)) +#define service_descriptor_free(d) \ + FREE_AND_NULL_UNMATCHED(hs_service_descriptor_t, \ + service_descriptor_free_, (d)) STATIC uint64_t check_state_line_for_service_rev_counter(const char *state_line, |