summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-18 03:23:26 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-18 03:23:26 +0000
commita3962bf6fc449cfa852d4bdc5e406244a91d2064 (patch)
treeba786ca2c9de2c2773d53cf11c2ac448bbc6244e
parentaf3fc006a51326587a06818541570c95c31368d5 (diff)
downloadtor-a3962bf6fc449cfa852d4bdc5e406244a91d2064.tar.gz
tor-a3962bf6fc449cfa852d4bdc5e406244a91d2064.zip
fix two more memory problems
one remains :) svn:r621
-rw-r--r--src/or/dirserv.c3
-rw-r--r--src/or/routers.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index e8257e4d2b..14219beb1f 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -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;
}
+
diff --git a/src/or/routers.c b/src/or/routers.c
index 2607c12059..f04fd24ed2 100644
--- a/src/or/routers.c
+++ b/src/or/routers.c
@@ -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: