[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r12185: Stop leaking memory every time we parse a v3 certificate. Bu (in tor/trunk: . src/or)
Author: arma
Date: 2007-10-25 09:18:37 -0400 (Thu, 25 Oct 2007)
New Revision: 12185
Modified:
tor/trunk/ChangeLog
tor/trunk/src/or/routerparse.c
Log:
Stop leaking memory every time we parse a v3 certificate. Bugfix
on 0.2.0.1-alpha.
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2007-10-25 12:43:47 UTC (rev 12184)
+++ tor/trunk/ChangeLog 2007-10-25 13:18:37 UTC (rev 12185)
@@ -2,6 +2,8 @@
o Minor bugfixes:
- Refuse to start if both ORPort and UseBridges are set. Bugfix
on 0.2.0.x.
+ - Stop leaking memory every time we parse a v3 certificate. Bugfix
+ on 0.2.0.1-alpha.
Changes in version 0.2.0.9-alpha - 2007-10-24
@@ -232,7 +234,7 @@
o Minor bugfixes (controller):
- When sending a status event to the controller telling it that an
- OR address is readable, set the port correctly. (Previously we
+ OR address is reachable, set the port correctly. (Previously we
were reporting the dir port.) Bugfix on 0.1.2.x.
o Minor bugfixes (v3 directory system):
Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c 2007-10-25 12:43:47 UTC (rev 12184)
+++ tor/trunk/src/or/routerparse.c 2007-10-25 13:18:37 UTC (rev 12185)
@@ -1392,7 +1392,7 @@
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 @@
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;
}