summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-10-25 13:18:37 +0000
committerRoger Dingledine <arma@torproject.org>2007-10-25 13:18:37 +0000
commitf37185bf0b58dd10f3432319ada40d06d5b41f80 (patch)
tree17acf404d1eda91a33fbccf1639a437f289d48d9 /src/or/routerparse.c
parent35dfb59ff2c3af37e62972573005406875242510 (diff)
downloadtor-f37185bf0b58dd10f3432319ada40d06d5b41f80.tar.gz
tor-f37185bf0b58dd10f3432319ada40d06d5b41f80.zip
Stop leaking memory every time we parse a v3 certificate. Bugfix
on 0.2.0.1-alpha. svn:r12185
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index a2ba0d27b8..02f666bc41 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1392,7 +1392,7 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
len = eos - s;
tokens = smartlist_create();
- if (tokenize_string(s, eos, tokens, dir_key_certificate_table,0) < 0) {
+ if (tokenize_string(s, eos, tokens, dir_key_certificate_table, 0) < 0) {
log_warn(LD_DIR, "Error tokenizing key certificate");
goto err;
}
@@ -1501,9 +1501,13 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
if (end_of_string) {
*end_of_string = eat_whitespace(eos);
}
+ SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t));
+ smartlist_free(tokens);
return cert;
err:
authority_cert_free(cert);
+ SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_free(t));
+ smartlist_free(tokens);
return NULL;
}