Beispiel #1
0
static void
test_rend_cache_entry_free(void *data)
{
  (void)data;
  rend_cache_entry_t *e;

  // Handles NULL correctly
  rend_cache_entry_free(NULL);

  // Handles NULL descriptor correctly
  e = tor_malloc_zero(sizeof(rend_cache_entry_t));
  rend_cache_entry_free(e);

  // Handles non-NULL descriptor correctly
  e = tor_malloc_zero(sizeof(rend_cache_entry_t));
  e->desc = (char *)malloc(10);
  rend_cache_entry_free(e);

 /* done: */
 /*  (void)0; */
}
Beispiel #2
0
/** Helper: deallocate a rend_cache_entry_t.  (Used with strmap_free(), which
 * requires a function pointer whose argument is void*). */
static void
rend_cache_entry_free_(void *p)
{
  rend_cache_entry_free(p);
}