diff options
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/connection_edge.c | 1 | ||||
-rw-r--r-- | src/or/rendclient.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index cf61be1e9b..61d60271fe 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -796,6 +796,7 @@ circuit_get_open_circ_or_launch(connection_t *conn, 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)) { diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 96ea145cae..e894cef5f4 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -205,7 +205,7 @@ int rend_cmp_service_ids(char *one, char *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. */ char *rend_client_get_random_intro(char *query) { @@ -215,6 +215,7 @@ 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); @@ -234,9 +235,10 @@ char *rend_client_get_random_intro(char *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, |