aboutsummaryrefslogtreecommitdiff
path: root/src/or/networkstatus.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/networkstatus.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/networkstatus.h')
-rw-r--r--src/or/networkstatus.h3
1 files changed, 2 insertions, 1 deletions
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);