From fa15ed4b7b0a2ebdc3eb64290ec52e1e338eda38 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 26 Mar 2008 21:16:56 +0000 Subject: [PATCH] r19079@catbus: nickm | 2008-03-26 17:16:46 -0400 Free authority certs on exit. Backport candidate. svn:r14205 --- ChangeLog | 2 ++ src/or/routerlist.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7a630928ab..4acbf3f18d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ Changes in version 0.2.1.1-alpha - 2008-??-?? running with dmalloc would crash. Bugfix on 0.2.0.x-alpha. - 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. o Minor features: - Allow separate log levels to be configured for different logging diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 2210173f80..b6889e9eaa 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2628,6 +2628,16 @@ 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