summaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-08 14:58:43 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-08 14:58:43 -0500
commit5ee0cccd49e57fad8c810e817d912d4a61dbc96c (patch)
tree2aa4d71a332805bcb1bf7746887e7435ffdc51f4 /src/or/rendclient.c
parent44010c6fc11608b13924372a179825946672cb23 (diff)
parent7ca5f4bf0365b853cdb0bab5cc9cb0ce6deaec26 (diff)
downloadtor-5ee0cccd49e57fad8c810e817d912d4a61dbc96c.tar.gz
tor-5ee0cccd49e57fad8c810e817d912d4a61dbc96c.zip
Merge branch 'macro_free_v2_squashed'
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 8291e5abfb..07fa33306d 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -1104,18 +1104,22 @@ rend_client_lookup_service_authorization(const char *onion_address)
return strmap_get(auth_hid_servs, onion_address);
}
+#define rend_service_authorization_free(val) \
+ FREE_AND_NULL(rend_service_authorization_t, \
+ rend_service_authorization_free_, (val))
+
/** Helper: Free storage held by rend_service_authorization_t. */
static void
-rend_service_authorization_free(rend_service_authorization_t *auth)
+rend_service_authorization_free_(rend_service_authorization_t *auth)
{
tor_free(auth);
}
/** Helper for strmap_free. */
static void
-rend_service_authorization_strmap_item_free(void *service_auth)
+rend_service_authorization_free_void(void *service_auth)
{
- rend_service_authorization_free(service_auth);
+ rend_service_authorization_free_(service_auth);
}
/** Release all the storage held in auth_hid_servs.
@@ -1126,7 +1130,7 @@ rend_service_authorization_free_all(void)
if (!auth_hid_servs) {
return;
}
- strmap_free(auth_hid_servs, rend_service_authorization_strmap_item_free);
+ strmap_free(auth_hid_servs, rend_service_authorization_free_void);
auth_hid_servs = NULL;
}
@@ -1201,7 +1205,7 @@ rend_parse_service_authorization(const or_options_t *options,
rend_service_authorization_free_all();
auth_hid_servs = parsed;
} else {
- strmap_free(parsed, rend_service_authorization_strmap_item_free);
+ strmap_free(parsed, rend_service_authorization_free_void);
}
return res;
}