new_circ_purpose = desired_circuit_purpose;
circ = circuit_launch_new(new_circ_purpose, exitname);
+ tor_free(exitname);
if(circ &&
(desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL)) {
return strcasecmp(one,two);
}
-/* return a pointer to a nickname for a random introduction
+/* strdup a nickname for a random introduction
* point of query. return NULL if error.
*/
char *rend_client_get_random_intro(char *query) {
smartlist_t *sl;
rend_service_descriptor_t *parsed;
char *choice;
+ char *nickname;
if(rend_cache_lookup(query, &descp, &desc_len) < 1) {
log_fn(LOG_WARN,"query '%s' didn't have valid rend desc in cache. Failing.", query);
smartlist_add(sl,parsed->intro_points[i]);
choice = smartlist_choose(sl);
+ nickname = tor_strdup(choice);
smartlist_free(sl);
rend_service_descriptor_free(parsed);
- return choice;
+ return nickname;
}
/* If address is of the form "y.onion" with a well-formed handle y,