[or-cvs] clean two more minor memory leaks

Roger Dingledine arma at seul.org
Tue Dec 7 19:42:47 UTC 2004


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	rendclient.c 
Log Message:
clean two more minor memory leaks


Index: rendclient.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendclient.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- rendclient.c	1 Dec 2004 03:48:13 -0000	1.70
+++ rendclient.c	7 Dec 2004 19:42:45 -0000	1.71
@@ -216,6 +216,7 @@
       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 @@
              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) {



More information about the tor-commits mailing list