diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-12-08 14:58:43 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-08 14:58:43 -0500 |
commit | 5ee0cccd49e57fad8c810e817d912d4a61dbc96c (patch) | |
tree | 2aa4d71a332805bcb1bf7746887e7435ffdc51f4 /src/or/rendservice.h | |
parent | 44010c6fc11608b13924372a179825946672cb23 (diff) | |
parent | 7ca5f4bf0365b853cdb0bab5cc9cb0ce6deaec26 (diff) | |
download | tor-5ee0cccd49e57fad8c810e817d912d4a61dbc96c.tar.gz tor-5ee0cccd49e57fad8c810e817d912d4a61dbc96c.zip |
Merge branch 'macro_free_v2_squashed'
Diffstat (limited to 'src/or/rendservice.h')
-rw-r--r-- | src/or/rendservice.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/or/rendservice.h b/src/or/rendservice.h index 15badce6ab..88da7b8665 100644 --- a/src/or/rendservice.h +++ b/src/or/rendservice.h @@ -117,7 +117,9 @@ typedef struct rend_service_t { int max_streams_close_circuit; } rend_service_t; -STATIC void rend_service_free(rend_service_t *service); +STATIC void rend_service_free_(rend_service_t *service); +#define rend_service_free(s) \ + FREE_AND_NULL(rend_service_t, rend_service_free_, (s)) STATIC char *rend_service_sos_poison_path(const rend_service_t *service); STATIC int rend_service_verify_single_onion_poison( const rend_service_t *s, @@ -160,7 +162,11 @@ int rend_service_receive_introduction(origin_circuit_t *circuit, int rend_service_decrypt_intro(rend_intro_cell_t *request, crypto_pk_t *key, char **err_msg_out); -void rend_service_free_intro(rend_intro_cell_t *request); +void rend_service_free_intro_(rend_intro_cell_t *request); +#define rend_service_free_intro(req) do { \ + rend_service_free_intro_(req); \ + (req) = NULL; \ + } while (0) rend_intro_cell_t * rend_service_begin_parse_intro(const uint8_t *request, size_t request_len, uint8_t type, @@ -183,9 +189,15 @@ void rend_service_init(void); rend_service_port_config_t *rend_service_parse_port_config(const char *string, const char *sep, char **err_msg_out); -void rend_service_port_config_free(rend_service_port_config_t *p); - -void rend_authorized_client_free(rend_authorized_client_t *client); +void rend_service_port_config_free_(rend_service_port_config_t *p); +#define rend_service_port_config_free(p) \ + FREE_AND_NULL(rend_service_port_config_t, rend_service_port_config_free_, \ + (p)) + +void rend_authorized_client_free_(rend_authorized_client_t *client); +#define rend_authorized_client_free(client) \ + FREE_AND_NULL(rend_authorized_client_t, rend_authorized_client_free_, \ + (client)) hs_service_add_ephemeral_status_t rend_service_add_ephemeral(crypto_pk_t *pk, smartlist_t *ports, |