[or-cvs] fix a memory leak

Roger Dingledine arma at seul.org
Sun Oct 24 23:09:51 UTC 2004


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

Modified Files:
	rendservice.c 
Log Message:
fix a memory leak


Index: rendservice.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendservice.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- rendservice.c	24 Oct 2004 19:08:07 -0000	1.93
+++ rendservice.c	24 Oct 2004 23:09:48 -0000	1.94
@@ -42,7 +42,7 @@
   crypto_pk_env_t *private_key;
   char service_id[REND_SERVICE_ID_LEN+1];
   char pk_digest[DIGEST_LEN];
-  smartlist_t *intro_nodes; /**< list of nicknames for intro points we have,
+  smartlist_t *intro_nodes; /**< list of hexdigests for intro points we have,
                              * or are trying to establish. */
   time_t intro_period_started;
   int n_intro_circuits_launched; /**< count of intro circuits we have
@@ -452,7 +452,7 @@
     log_fn(LOG_WARN,
            "Can't launch circuit to rendezvous point '%s' for service %s",
            rp_nickname, serviceid);
-    return -1;
+    goto err;
   }
   tor_assert(launched->build_state);
   /* Fill in the circuit's state. */
@@ -846,6 +846,7 @@
       changed = 1;
       smartlist_add(intro_routers, router);
       smartlist_add(exclude_routers, router);
+/*XXX009 should strdup the hexdigest, not nickname */
       smartlist_add(service->intro_nodes, tor_strdup(router->nickname));
       log_fn(LOG_INFO,"Picked router %s as an intro point for %s.", router->nickname,
              service->service_id);



More information about the tor-commits mailing list