diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-04-09 18:24:50 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-04-09 18:24:50 +0000 |
commit | 27ddacce624d7580a19e77fa8a6f0bd0db844eb4 (patch) | |
tree | 7dc6aca6da0c061b8a2f78e84c1feecdad633653 | |
parent | ae0d14d346dd69666f48d2c01a63504fceebe7fc (diff) | |
download | tor-27ddacce624d7580a19e77fa8a6f0bd0db844eb4.tar.gz tor-27ddacce624d7580a19e77fa8a6f0bd0db844eb4.zip |
r19268@catbus: nickm | 2008-04-09 14:20:54 -0400
Backport 14205: Free authority certificates on exit, so they dont look like memory leaks.
svn:r14332
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | doc/TODO.020 | 2 | ||||
-rw-r--r-- | src/or/routerlist.c | 11 |
3 files changed, 14 insertions, 1 deletions
@@ -11,6 +11,8 @@ Changes in version 0.2.0.24-rc - 2008-04-0? - When opening a logfile fails, tell us why. - Keep address policies from leaking: start their refcount at 1, not 2. Bugfix on 0.2.0.16-alpha. + - Free authority certificates on exit, so they don't look like memory + leaks. Bugfix on 0.2.0.19-alpha. Changes in version 0.2.0.23-rc - 2008-03-24 diff --git a/doc/TODO.020 b/doc/TODO.020 index 4e6d3b7fb1..1e9f03ca0f 100644 --- a/doc/TODO.020 +++ b/doc/TODO.020 @@ -4,7 +4,7 @@ description of the patch.) Backport items for 0.2.0: o r14204: start policy refcounts at 1, not 2. - - r14205: free authority certs on exit. + o r14205: free authority certs on exit. - r14212: free static hashtables and log mutex on exit. - r14214: don't read torrc when all we - r14329: update last_added_nonpadding for relay cells. diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 2210173f80..146b1457c1 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2628,6 +2628,17 @@ routerlist_free_all(void) smartlist_free(trusted_dir_servers); trusted_dir_servers = NULL; } + + if (trusted_dir_certs) { + DIGESTMAP_FOREACH(trusted_dir_certs, key, cert_list_t *, cl) { + SMARTLIST_FOREACH(cl->certs, authority_cert_t *, cert, + authority_cert_free(cert)); + smartlist_free(cl->certs); + tor_free(cl); + } DIGESTMAP_FOREACH_END; + digestmap_free(trusted_dir_certs, NULL); + trusted_dir_certs = NULL; + } } /** Forget that we have issued any router-related warnings, so that we'll |