]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fix two more memory problems
authorRoger Dingledine <arma@torproject.org>
Sat, 18 Oct 2003 03:23:26 +0000 (03:23 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 18 Oct 2003 03:23:26 +0000 (03:23 +0000)
one remains :)

svn:r621

src/or/dirserv.c
src/or/routers.c

index e8257e4d2b478546eb1d29457c99a9ead8f2620c..14219beb1f917523c49800ecc40f997c6977bbec 100644 (file)
@@ -251,7 +251,7 @@ dirserv_add_descriptor(const char **desc)
   }
   
   (*desc_ent_ptr) = tor_malloc(sizeof(descriptor_entry_t));
-  (*desc_ent_ptr)->nickname = ri->nickname;
+  (*desc_ent_ptr)->nickname = strdup(ri->nickname);
   (*desc_ent_ptr)->published = ri->published_on;
   (*desc_ent_ptr)->desc_len = desc_len;
   (*desc_ent_ptr)->descriptor = tor_malloc(desc_len+1);
@@ -444,3 +444,4 @@ size_t dirserv_get_directory(const char **directory)
   *directory = the_directory;
   return the_directory_len;
 }
+
index 2607c12059d46541b0d2ce6eb685dc8abad84a99..f04fd24ed291d5bcd3a2ad6445a4fa4d9b114dca 100644 (file)
@@ -771,7 +771,6 @@ routerinfo_t *router_get_entry_from_string(char**s) {
   directory_token_t _tok;
   directory_token_t *tok = &_tok;
   struct tm published;
-
   int t;
 
 #define NEXT_TOKEN()                                                     \
@@ -916,6 +915,7 @@ routerinfo_t *router_get_entry_from_string(char**s) {
     goto err;
   }
   
+  router_release_token(tok); /* free the signature */
   return router;
 
  err: