From db024adc90069ce9961f3993aba1b7372f09d77a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 4 Dec 2017 15:09:18 -0500 Subject: 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. --- src/or/networkstatus.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/or/networkstatus.h') diff --git a/src/or/networkstatus.h b/src/or/networkstatus.h index f62b5d2409..37350bb1b3 100644 --- a/src/or/networkstatus.h +++ b/src/or/networkstatus.h @@ -21,7 +21,8 @@ int router_reload_consensus_networkstatus(void); void routerstatus_free_(routerstatus_t *rs); #define routerstatus_free(rs) FREE_AND_NULL(routerstatus, (rs)) void networkstatus_vote_free_(networkstatus_t *ns); -#define networkstatus_vote_free(ns) FREE_AND_NULL(networkstatus_vote, (ns)) +#define networkstatus_vote_free(ns) \ + FREE_AND_NULL_UNMATCHED(networkstatus_t, networkstatus_vote_free_, (ns)) networkstatus_voter_info_t *networkstatus_get_voter_by_id( networkstatus_t *vote, const char *identity); -- cgit v1.2.3-54-g00ecf