mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
strdup the intro point when you pick it, so you
don't free it and then return it svn:r1483
This commit is contained in:
parent
ac84512489
commit
92bb5b2860
@ -796,6 +796,7 @@ circuit_get_open_circ_or_launch(connection_t *conn,
|
|||||||
new_circ_purpose = desired_circuit_purpose;
|
new_circ_purpose = desired_circuit_purpose;
|
||||||
|
|
||||||
circ = circuit_launch_new(new_circ_purpose, exitname);
|
circ = circuit_launch_new(new_circ_purpose, exitname);
|
||||||
|
tor_free(exitname);
|
||||||
|
|
||||||
if(circ &&
|
if(circ &&
|
||||||
(desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL)) {
|
(desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL)) {
|
||||||
|
@ -205,7 +205,7 @@ int rend_cmp_service_ids(char *one, char *two) {
|
|||||||
return strcasecmp(one,two);
|
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.
|
* point of query. return NULL if error.
|
||||||
*/
|
*/
|
||||||
char *rend_client_get_random_intro(char *query) {
|
char *rend_client_get_random_intro(char *query) {
|
||||||
@ -215,6 +215,7 @@ char *rend_client_get_random_intro(char *query) {
|
|||||||
smartlist_t *sl;
|
smartlist_t *sl;
|
||||||
rend_service_descriptor_t *parsed;
|
rend_service_descriptor_t *parsed;
|
||||||
char *choice;
|
char *choice;
|
||||||
|
char *nickname;
|
||||||
|
|
||||||
if(rend_cache_lookup(query, &descp, &desc_len) < 1) {
|
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);
|
log_fn(LOG_WARN,"query '%s' didn't have valid rend desc in cache. Failing.", query);
|
||||||
@ -234,9 +235,10 @@ char *rend_client_get_random_intro(char *query) {
|
|||||||
smartlist_add(sl,parsed->intro_points[i]);
|
smartlist_add(sl,parsed->intro_points[i]);
|
||||||
|
|
||||||
choice = smartlist_choose(sl);
|
choice = smartlist_choose(sl);
|
||||||
|
nickname = tor_strdup(choice);
|
||||||
smartlist_free(sl);
|
smartlist_free(sl);
|
||||||
rend_service_descriptor_free(parsed);
|
rend_service_descriptor_free(parsed);
|
||||||
return choice;
|
return nickname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If address is of the form "y.onion" with a well-formed handle y,
|
/* If address is of the form "y.onion" with a well-formed handle y,
|
||||||
|
Loading…
Reference in New Issue
Block a user