Commit 3807db00 authored by Sebastian Hahn's avatar Sebastian Hahn
Browse files

*_free functions now accept NULL

Some *_free functions threw asserts when passed NULL. Now all of them
accept NULL as input and perform no action when called that way.

This gains us consistence for our free functions, and allows some
code simplifications where an explicit null check is no longer necessary.
parent 4afdb790
...@@ -1563,7 +1563,7 @@ clean_cell_pool(void) ...@@ -1563,7 +1563,7 @@ clean_cell_pool(void)
/** Release storage held by <b>cell</b>. */ /** Release storage held by <b>cell</b>. */
static INLINE void static INLINE void
packed_cell_free(packed_cell_t *cell) packed_cell_free_unchecked(packed_cell_t *cell)
{ {
--total_cells_allocated; --total_cells_allocated;
mp_pool_release(cell); mp_pool_release(cell);
...@@ -1667,7 +1667,7 @@ cell_queue_clear(cell_queue_t *queue) ...@@ -1667,7 +1667,7 @@ cell_queue_clear(cell_queue_t *queue)
cell = queue->head; cell = queue->head;
while (cell) { while (cell) {
next = cell->next; next = cell->next;
packed_cell_free(cell); packed_cell_free_unchecked(cell);
cell = next; cell = next;
} }
queue->head = queue->tail = NULL; queue->head = queue->tail = NULL;
...@@ -1913,7 +1913,7 @@ connection_or_flush_from_first_active_circuit(or_connection_t *conn, int max, ...@@ -1913,7 +1913,7 @@ connection_or_flush_from_first_active_circuit(or_connection_t *conn, int max,
connection_write_to_buf(cell->body, CELL_NETWORK_SIZE, TO_CONN(conn)); connection_write_to_buf(cell->body, CELL_NETWORK_SIZE, TO_CONN(conn));
packed_cell_free(cell); packed_cell_free_unchecked(cell);
++n_flushed; ++n_flushed;
if (circ != conn->active_circuits) { if (circ != conn->active_circuits) {
/* If this happens, the current circuit just got made inactive by /* If this happens, the current circuit just got made inactive by
......
...@@ -22,6 +22,8 @@ rend_cmp_service_ids(const char *one, const char *two) ...@@ -22,6 +22,8 @@ rend_cmp_service_ids(const char *one, const char *two)
void void
rend_service_descriptor_free(rend_service_descriptor_t *desc) rend_service_descriptor_free(rend_service_descriptor_t *desc)
{ {
if (!desc)
return;
if (desc->pk) if (desc->pk)
crypto_free_pk_env(desc->pk); crypto_free_pk_env(desc->pk);
if (desc->intro_nodes) { if (desc->intro_nodes) {
...@@ -414,6 +416,8 @@ void ...@@ -414,6 +416,8 @@ void
rend_encoded_v2_service_descriptor_free( rend_encoded_v2_service_descriptor_free(
rend_encoded_v2_service_descriptor_t *desc) rend_encoded_v2_service_descriptor_t *desc)
{ {
if (!desc)
return;
tor_free(desc->desc_str); tor_free(desc->desc_str);
tor_free(desc); tor_free(desc);
} }
...@@ -422,6 +426,8 @@ rend_encoded_v2_service_descriptor_free( ...@@ -422,6 +426,8 @@ rend_encoded_v2_service_descriptor_free(
void void
rend_intro_point_free(rend_intro_point_t *intro) rend_intro_point_free(rend_intro_point_t *intro)
{ {
if (!intro)
return;
if (intro->extend_info) if (intro->extend_info)
extend_info_free(intro->extend_info); extend_info_free(intro->extend_info);
if (intro->intro_key) if (intro->intro_key)
......
...@@ -87,7 +87,8 @@ num_rend_services(void) ...@@ -87,7 +87,8 @@ num_rend_services(void)
static void static void
rend_authorized_client_free(rend_authorized_client_t *client) rend_authorized_client_free(rend_authorized_client_t *client)
{ {
if (!client) return; if (!client)
return;
if (client->client_key) if (client->client_key)
crypto_free_pk_env(client->client_key); crypto_free_pk_env(client->client_key);
tor_free(client->client_name); tor_free(client->client_name);
...@@ -106,7 +107,9 @@ rend_authorized_client_strmap_item_free(void *authorized_client) ...@@ -106,7 +107,9 @@ rend_authorized_client_strmap_item_free(void *authorized_client)
static void static void
rend_service_free(rend_service_t *service) rend_service_free(rend_service_t *service)
{ {
if (!service) return; if (!service)
return;
tor_free(service->directory); tor_free(service->directory);
SMARTLIST_FOREACH(service->ports, void*, p, tor_free(p)); SMARTLIST_FOREACH(service->ports, void*, p, tor_free(p));
smartlist_free(service->ports); smartlist_free(service->ports);
...@@ -134,9 +137,9 @@ rend_service_free(rend_service_t *service) ...@@ -134,9 +137,9 @@ rend_service_free(rend_service_t *service)
void void
rend_service_free_all(void) rend_service_free_all(void)
{ {
if (!rend_service_list) { if (!rend_service_list)
return; return;
}
SMARTLIST_FOREACH(rend_service_list, rend_service_t*, ptr, SMARTLIST_FOREACH(rend_service_list, rend_service_t*, ptr,
rend_service_free(ptr)); rend_service_free(ptr));
smartlist_free(rend_service_list); smartlist_free(rend_service_list);
......
...@@ -2272,6 +2272,8 @@ static void ...@@ -2272,6 +2272,8 @@ static void
hs_usage_general_period_related_observations_free( hs_usage_general_period_related_observations_free(
hs_usage_general_period_related_observations_t *s) hs_usage_general_period_related_observations_t *s)
{ {
if (!s)
return;
rephist_total_alloc-=sizeof(hs_usage_general_period_related_observations_t); rephist_total_alloc-=sizeof(hs_usage_general_period_related_observations_t);
tor_free(s); tor_free(s);
} }
...@@ -2281,6 +2283,8 @@ static void ...@@ -2281,6 +2283,8 @@ static void
hs_usage_current_observation_period_free( hs_usage_current_observation_period_free(
hs_usage_current_observation_period_t *s) hs_usage_current_observation_period_t *s)
{ {
if (!s)
return;
rephist_total_alloc -= sizeof(hs_usage_current_observation_period_t); rephist_total_alloc -= sizeof(hs_usage_current_observation_period_t);
tor_free(s); tor_free(s);
} }
......
...@@ -2378,6 +2378,9 @@ extrainfo_free(extrainfo_t *extrainfo) ...@@ -2378,6 +2378,9 @@ extrainfo_free(extrainfo_t *extrainfo)
static void static void
signed_descriptor_free(signed_descriptor_t *sd) signed_descriptor_free(signed_descriptor_t *sd)
{ {
if (!sd)
return;
tor_free(sd->signed_descriptor_body); tor_free(sd->signed_descriptor_body);
/* XXXX remove this once more bugs go away. */ /* XXXX remove this once more bugs go away. */
...@@ -2409,7 +2412,8 @@ _extrainfo_free(void *e) ...@@ -2409,7 +2412,8 @@ _extrainfo_free(void *e)
void void
routerlist_free(routerlist_t *rl) routerlist_free(routerlist_t *rl)
{ {
tor_assert(rl); if (!rl)
return;
rimap_free(rl->identity_map, NULL); rimap_free(rl->identity_map, NULL);
sdmap_free(rl->desc_digest_map, NULL); sdmap_free(rl->desc_digest_map, NULL);
sdmap_free(rl->desc_by_eid_map, NULL); sdmap_free(rl->desc_by_eid_map, NULL);
...@@ -3779,6 +3783,9 @@ authority_cert_free(authority_cert_t *cert) ...@@ -3779,6 +3783,9 @@ authority_cert_free(authority_cert_t *cert)
static void static void
trusted_dir_server_free(trusted_dir_server_t *ds) trusted_dir_server_free(trusted_dir_server_t *ds)
{ {
if (!ds)
return;
tor_free(ds->nickname); tor_free(ds->nickname);
tor_free(ds->description); tor_free(ds->description);
tor_free(ds->address); tor_free(ds->address);
...@@ -5305,6 +5312,9 @@ routerset_equal(const routerset_t *old, const routerset_t *new) ...@@ -5305,6 +5312,9 @@ routerset_equal(const routerset_t *old, const routerset_t *new)
void void
routerset_free(routerset_t *routerset) routerset_free(routerset_t *routerset)
{ {
if (!routerset)
return;
SMARTLIST_FOREACH(routerset->list, char *, cp, tor_free(cp)); SMARTLIST_FOREACH(routerset->list, char *, cp, tor_free(cp));
smartlist_free(routerset->list); smartlist_free(routerset->list);
SMARTLIST_FOREACH(routerset->policies, addr_policy_t *, p, SMARTLIST_FOREACH(routerset->policies, addr_policy_t *, p,
......
...@@ -151,7 +151,7 @@ typedef enum { ...@@ -151,7 +151,7 @@ typedef enum {
* type. * type.
* *
* This structure is only allocated in memareas; do not allocate it on * This structure is only allocated in memareas; do not allocate it on
* the heap, or token_free() won't work. * the heap, or token_clear() won't work.
*/ */
typedef struct directory_token_t { typedef struct directory_token_t {
directory_keyword tp; /**< Type of the token. */ directory_keyword tp; /**< Type of the token. */
...@@ -523,7 +523,7 @@ static int router_get_hash_impl(const char *s, char *digest, ...@@ -523,7 +523,7 @@ static int router_get_hash_impl(const char *s, char *digest,
static int router_get_hashes_impl(const char *s, digests_t *digests, static int router_get_hashes_impl(const char *s, digests_t *digests,
const char *start_str, const char *end_str, const char *start_str, const char *end_str,
char end_char); char end_char);
static void token_free(directory_token_t *tok); static void token_clear(directory_token_t *tok);
static smartlist_t *find_all_exitpolicy(smartlist_t *s); static smartlist_t *find_all_exitpolicy(smartlist_t *s);
static directory_token_t *_find_by_keyword(smartlist_t *s, static directory_token_t *_find_by_keyword(smartlist_t *s,
directory_keyword keyword, directory_keyword keyword,
...@@ -844,7 +844,7 @@ router_parse_directory(const char *str) ...@@ -844,7 +844,7 @@ router_parse_directory(const char *str)
CST_CHECK_AUTHORITY, "directory")<0) CST_CHECK_AUTHORITY, "directory")<0)
goto err; goto err;
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_clear(tokens); smartlist_clear(tokens);
memarea_clear(area); memarea_clear(area);
...@@ -882,7 +882,7 @@ router_parse_directory(const char *str) ...@@ -882,7 +882,7 @@ router_parse_directory(const char *str)
done: done:
if (declared_key) crypto_free_pk_env(declared_key); if (declared_key) crypto_free_pk_env(declared_key);
if (tokens) { if (tokens) {
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
} }
if (area) { if (area) {
...@@ -948,7 +948,7 @@ router_parse_runningrouters(const char *str) ...@@ -948,7 +948,7 @@ router_parse_runningrouters(const char *str)
dump_desc(str_dup, "v1 running-routers"); dump_desc(str_dup, "v1 running-routers");
if (declared_key) crypto_free_pk_env(declared_key); if (declared_key) crypto_free_pk_env(declared_key);
if (tokens) { if (tokens) {
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
} }
if (area) { if (area) {
...@@ -998,7 +998,7 @@ find_dir_signing_key(const char *str, const char *eos) ...@@ -998,7 +998,7 @@ find_dir_signing_key(const char *str, const char *eos)
} }
done: done:
if (tok) token_free(tok); if (tok) token_clear(tok);
if (area) { if (area) {
DUMP_AREA(area, "dir-signing-key token"); DUMP_AREA(area, "dir-signing-key token");
memarea_drop_all(area); memarea_drop_all(area);
...@@ -1551,7 +1551,7 @@ router_parse_entry_from_string(const char *s, const char *end, ...@@ -1551,7 +1551,7 @@ router_parse_entry_from_string(const char *s, const char *end,
router = NULL; router = NULL;
done: done:
if (tokens) { if (tokens) {
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
} }
if (exit_policy_tokens) { if (exit_policy_tokens) {
...@@ -1677,7 +1677,7 @@ extrainfo_parse_entry_from_string(const char *s, const char *end, ...@@ -1677,7 +1677,7 @@ extrainfo_parse_entry_from_string(const char *s, const char *end,
extrainfo = NULL; extrainfo = NULL;
done: done:
if (tokens) { if (tokens) {
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
} }
if (area) { if (area) {
...@@ -1848,7 +1848,7 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string) ...@@ -1848,7 +1848,7 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
if (end_of_string) { if (end_of_string) {
*end_of_string = eat_whitespace(eos); *end_of_string = eat_whitespace(eos);
} }
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
if (area) { if (area) {
DUMP_AREA(area, "authority cert"); DUMP_AREA(area, "authority cert");
...@@ -1858,7 +1858,7 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string) ...@@ -1858,7 +1858,7 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
err: err:
dump_desc(s_dup, "authority cert"); dump_desc(s_dup, "authority cert");
authority_cert_free(cert); authority_cert_free(cert);
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
if (area) { if (area) {
DUMP_AREA(area, "authority cert"); DUMP_AREA(area, "authority cert");
...@@ -2129,7 +2129,7 @@ routerstatus_parse_entry_from_string(memarea_t *area, ...@@ -2129,7 +2129,7 @@ routerstatus_parse_entry_from_string(memarea_t *area,
routerstatus_free(rs); routerstatus_free(rs);
rs = NULL; rs = NULL;
done: done:
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_clear(tokens); smartlist_clear(tokens);
if (area) { if (area) {
DUMP_AREA(area, "routerstatus entry"); DUMP_AREA(area, "routerstatus entry");
...@@ -2280,7 +2280,7 @@ networkstatus_v2_parse_from_string(const char *s) ...@@ -2280,7 +2280,7 @@ networkstatus_v2_parse_from_string(const char *s)
ns->entries = smartlist_create(); ns->entries = smartlist_create();
s = eos; s = eos;
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_clear(tokens); smartlist_clear(tokens);
memarea_clear(area); memarea_clear(area);
while (!strcmpstart(s, "r ")) { while (!strcmpstart(s, "r ")) {
...@@ -2320,9 +2320,9 @@ networkstatus_v2_parse_from_string(const char *s) ...@@ -2320,9 +2320,9 @@ networkstatus_v2_parse_from_string(const char *s)
networkstatus_v2_free(ns); networkstatus_v2_free(ns);
ns = NULL; ns = NULL;
done: done:
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
SMARTLIST_FOREACH(footer_tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(footer_tokens, directory_token_t *, t, token_clear(t));
smartlist_free(footer_tokens); smartlist_free(footer_tokens);
if (area) { if (area) {
DUMP_AREA(area, "v2 networkstatus"); DUMP_AREA(area, "v2 networkstatus");
...@@ -2799,7 +2799,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out, ...@@ -2799,7 +2799,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
ns = NULL; ns = NULL;
done: done:
if (tokens) { if (tokens) {
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
} }
if (voter) { if (voter) {
...@@ -2814,11 +2814,11 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out, ...@@ -2814,11 +2814,11 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
tor_free(voter); tor_free(voter);
} }
if (rs_tokens) { if (rs_tokens) {
SMARTLIST_FOREACH(rs_tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(rs_tokens, directory_token_t *, t, token_clear(t));
smartlist_free(rs_tokens); smartlist_free(rs_tokens);
} }
if (footer_tokens) { if (footer_tokens) {
SMARTLIST_FOREACH(footer_tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(footer_tokens, directory_token_t *, t, token_clear(t));
smartlist_free(footer_tokens); smartlist_free(footer_tokens);
} }
if (area) { if (area) {
...@@ -3052,7 +3052,7 @@ networkstatus_parse_detached_signatures(const char *s, const char *eos) ...@@ -3052,7 +3052,7 @@ networkstatus_parse_detached_signatures(const char *s, const char *eos)
ns_detached_signatures_free(sigs); ns_detached_signatures_free(sigs);
sigs = NULL; sigs = NULL;
done: done:
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
if (area) { if (area) {
DUMP_AREA(area, "detached signatures"); DUMP_AREA(area, "detached signatures");
...@@ -3108,7 +3108,7 @@ router_parse_addr_policy_item_from_string(const char *s, int assume_action) ...@@ -3108,7 +3108,7 @@ router_parse_addr_policy_item_from_string(const char *s, int assume_action)
err: err:
r = NULL; r = NULL;
done: done:
token_free(tok); token_clear(tok);
if (area) { if (area) {
DUMP_AREA(area, "policy item"); DUMP_AREA(area, "policy item");
memarea_drop_all(area); memarea_drop_all(area);
...@@ -3231,9 +3231,8 @@ assert_addr_policy_ok(smartlist_t *lst) ...@@ -3231,9 +3231,8 @@ assert_addr_policy_ok(smartlist_t *lst)
/** Free all resources allocated for <b>tok</b> */ /** Free all resources allocated for <b>tok</b> */
static void static void
token_free(directory_token_t *tok) token_clear(directory_token_t *tok)
{ {
tor_assert(tok);
if (tok->key) if (tok->key)
crypto_free_pk_env(tok->key); crypto_free_pk_env(tok->key);
} }
...@@ -3245,7 +3244,7 @@ token_free(directory_token_t *tok) ...@@ -3245,7 +3244,7 @@ token_free(directory_token_t *tok)
#define RET_ERR(msg) \ #define RET_ERR(msg) \
STMT_BEGIN \ STMT_BEGIN \
if (tok) token_free(tok); \ if (tok) token_clear(tok); \
tok = ALLOC_ZERO(sizeof(directory_token_t)); \ tok = ALLOC_ZERO(sizeof(directory_token_t)); \
tok->tp = _ERR; \ tok->tp = _ERR; \
tok->error = STRDUP(msg); \ tok->error = STRDUP(msg); \
...@@ -3523,7 +3522,7 @@ tokenize_string(memarea_t *area, ...@@ -3523,7 +3522,7 @@ tokenize_string(memarea_t *area,
tok = get_next_token(area, s, end, table); tok = get_next_token(area, s, end, table);
if (tok->tp == _ERR) { if (tok->tp == _ERR) {
log_warn(LD_DIR, "parse error: %s", tok->error); log_warn(LD_DIR, "parse error: %s", tok->error);
token_free(tok); token_clear(tok);
return -1; return -1;
} }
++counts[tok->tp]; ++counts[tok->tp];
...@@ -4270,7 +4269,7 @@ rend_parse_v2_service_descriptor(rend_service_descriptor_t **parsed_out, ...@@ -4270,7 +4269,7 @@ rend_parse_v2_service_descriptor(rend_service_descriptor_t **parsed_out,
result = NULL; result = NULL;
done: done:
if (tokens) { if (tokens) {
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
} }
if (area) if (area)
...@@ -4428,7 +4427,7 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed, ...@@ -4428,7 +4427,7 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed,
eos = eos+1; eos = eos+1;
tor_assert(eos <= intro_points_encoded+intro_points_encoded_size); tor_assert(eos <= intro_points_encoded+intro_points_encoded_size);
/* Free tokens and clear token list. */ /* Free tokens and clear token list. */
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_clear(tokens); smartlist_clear(tokens);
memarea_clear(area); memarea_clear(area);
/* Tokenize string. */ /* Tokenize string. */
...@@ -4501,7 +4500,7 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed, ...@@ -4501,7 +4500,7 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed,
done: done:
/* Free tokens and clear token list. */ /* Free tokens and clear token list. */
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
if (area) if (area)
memarea_drop_all(area); memarea_drop_all(area);
...@@ -4540,7 +4539,7 @@ rend_parse_client_keys(strmap_t *parsed_clients, const char *ckstr) ...@@ -4540,7 +4539,7 @@ rend_parse_client_keys(strmap_t *parsed_clients, const char *ckstr)
else else
eos = eos + 1; eos = eos + 1;
/* Free tokens and clear token list. */ /* Free tokens and clear token list. */
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_clear(tokens); smartlist_clear(tokens);
memarea_clear(area); memarea_clear(area);
/* Tokenize string. */ /* Tokenize string. */
...@@ -4612,7 +4611,7 @@ rend_parse_client_keys(strmap_t *parsed_clients, const char *ckstr) ...@@ -4612,7 +4611,7 @@ rend_parse_client_keys(strmap_t *parsed_clients, const char *ckstr)
result = -1; result = -1;
done: done:
/* Free tokens and clear token list. */ /* Free tokens and clear token list. */
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t)); SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
smartlist_free(tokens); smartlist_free(tokens);
if (area) if (area)
memarea_drop_all(area); memarea_drop_all(area);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment