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/common/compat_libevent.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/common/compat_libevent.h')
-rw-r--r-- | src/common/compat_libevent.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h index 65807315c9..2c86194d04 100644 --- a/src/common/compat_libevent.h +++ b/src/common/compat_libevent.h @@ -20,7 +20,8 @@ void suppress_libevent_log_msg(const char *msg); (sock),(tcp),(cb),(data)); void tor_event_free_(struct event *ev); -#define tor_event_free(ev) FREE_AND_NULL(tor_event, (ev)) +#define tor_event_free(ev) \ + FREE_AND_NULL_UNMATCHED(struct event, tor_event_free_, (ev)) typedef struct periodic_timer_t periodic_timer_t; |