or_options_t *options;
uint32_t resolved_addr;
const char *method_used;
- char *hostname_out;
+ char *hostname_out = NULL;
int retval;
int prev_n_hostname_01010101;
int prev_n_hostname_localhost;
UNMOCK(tor_lookup_hostname);
tor_free(options->Address);
+ tor_free(hostname_out);
/*
* CASE 3:
UNMOCK(tor_gethostname);
UNMOCK(tor_lookup_hostname);
+ tor_free(hostname_out);
+
/*
* CASE 4:
* Given that options->Address is a local host address, we want
tt_assert(retval == -1);
tor_free(options->Address);
+ tor_free(hostname_out);
/*
* CASE 5:
UNMOCK(tor_lookup_hostname);
tor_free(options->Address);
- options->Address = NULL;
+ tor_free(hostname_out);
/*
* CASE 6:
tt_assert(retval == -1);
UNMOCK(tor_gethostname);
+ tor_free(hostname_out);
+
/*
* CASE 7:
tt_assert(resolved_addr == ntohl(0x08080808));
UNMOCK(get_interface_address);
+ tor_free(hostname_out);
/*
* CASE 8:
tt_assert(retval == -1);
UNMOCK(get_interface_address);
+ tor_free(hostname_out);
/*
* CASE 9:
UNMOCK(tor_gethostname);
UNMOCK(get_interface_address6);
+ tor_free(hostname_out);
+
/*
* CASE 10: We want resolve_my_address() to fail if all of the following
* are true:
UNMOCK(tor_gethostname);
UNMOCK(tor_lookup_hostname);
+ tor_free(hostname_out);
+
/*
* CASE 11:
* Suppose the following sequence of events:
UNMOCK(tor_gethostname);
- done:
+ done:
tor_free(options->Address);
tor_free(options->DirAuthorities);
or_options_free(options);
+ tor_free(hostname_out);
UNMOCK(tor_gethostname);
UNMOCK(tor_lookup_hostname);