Change the free macro convention in the rest of src/or/*.h

This commit is contained in:
Nick Mathewson
2017-11-21 09:37:47 -05:00
parent 0792cc107e
commit 176ad729d9
66 changed files with 234 additions and 153 deletions
+4 -4
View File
@@ -834,7 +834,7 @@ test_rend_cache_failure_entry_free(void *data)
(void)data;
// Test that it can deal with a NULL argument
rend_cache_failure_entry_free(NULL);
rend_cache_failure_entry_free_(NULL);
/* done: */
/* (void)0; */
@@ -963,7 +963,7 @@ test_rend_cache_entry_free(void *data)
rend_cache_entry_t *e;
// Handles NULL correctly
rend_cache_entry_free(NULL);
rend_cache_entry_free_(NULL);
// Handles NULL descriptor correctly
e = tor_malloc_zero(sizeof(rend_cache_entry_t));
@@ -1135,7 +1135,7 @@ test_rend_cache_failure_intro_entry_free(void *data)
rend_cache_failure_intro_t *entry;
// Handles a null argument
rend_cache_failure_intro_entry_free(NULL);
rend_cache_failure_intro_entry_free_(NULL);
// Handles a non-null argument
entry = rend_cache_failure_intro_entry_new(INTRO_POINT_FAILURE_TIMEOUT);
@@ -1148,7 +1148,7 @@ test_rend_cache_failure_purge(void *data)
(void)data;
// Handles a null failure cache
strmap_free(rend_cache_failure, rend_cache_failure_entry_free_);
strmap_free(rend_cache_failure, rend_cache_failure_entry_free_void);
rend_cache_failure = NULL;
rend_cache_failure_purge();
+1 -1
View File
@@ -74,7 +74,7 @@ static void
test_replaycache_free_null(void *arg)
{
(void)arg;
replaycache_free(NULL);
replaycache_free_(NULL);
/* Assert that we're here without horrible death */
tt_assert(1);
+5 -5
View File
@@ -699,7 +699,7 @@ NS(test_main)(void *arg)
static void
NS(test_main)(void *arg)
{
const routerset_t *set;
routerset_t *set;
int needs_geoip;
(void)arg;
@@ -709,14 +709,14 @@ NS(test_main)(void *arg)
set = routerset_new();
needs_geoip = routerset_needs_geoip(set);
routerset_free((routerset_t *)set);
routerset_free(set);
tt_int_op(needs_geoip, OP_EQ, 0);
set = NULL;
set = routerset_new();
smartlist_add(set->country_names, tor_strndup("xx", 2));
needs_geoip = routerset_needs_geoip(set);
routerset_free((routerset_t *)set);
routerset_free(set);
set = NULL;
tt_int_op(needs_geoip, OP_NE, 0);
@@ -1947,7 +1947,7 @@ NS(test_main)(void *arg)
done:
tor_free(s);
routerset_free((routerset_t *)set);
routerset_free(set);
}
#undef NS_SUBMODULE
@@ -2093,7 +2093,7 @@ NS(test_main)(void *arg)
NS_MOCK(smartlist_free_);
routerset_free(NULL);
routerset_free_(NULL);
tt_int_op(CALLED(smartlist_free_), OP_EQ, 0);