aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-12-07 19:42:45 +0000
committerRoger Dingledine <arma@torproject.org>2004-12-07 19:42:45 +0000
commit33cf6f2f61a4d83a7c4e30b7aca22ec5a0afc66b (patch)
tree8f15e5cb839340f6715de4e4f198bd80155273ea /src/or/rendclient.c
parent06ce31b9488fe77e4c03249ac9398bd915909a30 (diff)
downloadtor-33cf6f2f61a4d83a7c4e30b7aca22ec5a0afc66b.tar
tor-33cf6f2f61a4d83a7c4e30b7aca22ec5a0afc66b.tar.gz
clean two more minor memory leaks
svn:r3115
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 48f60ee8c..96c25159e 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -216,6 +216,7 @@ rend_client_introduction_acked(circuit_t *circ,
if (!(r = router_get_by_nickname(nickname))) {
log_fn(LOG_WARN, "Advertised intro point '%s' for %s is not known. Closing.",
nickname, circ->rend_query);
+ tor_free(nickname);
circuit_mark_for_close(circ);
return -1;
}
@@ -223,7 +224,9 @@ rend_client_introduction_acked(circuit_t *circ,
nickname, circ->rend_query, circ->n_circ_id);
circ->state = CIRCUIT_STATE_BUILDING;
tor_free(circ->build_state->chosen_exit_name);
- circ->build_state->chosen_exit_name = tor_strdup(nickname);
+ /* no need to strdup, since rend_client_get_random_intro() made
+ * it just for us: */
+ circ->build_state->chosen_exit_name = nickname;
memcpy(circ->build_state->chosen_exit_digest, r->identity_digest, DIGEST_LEN);
++circ->build_state->desired_path_len;
if (circuit_send_next_onion_skin(circ)<0) {