[or-cvs] r14332: Backport 14205: Free authority certificates on exit, so they (in tor/branches/tor-0_2_0-patches: . doc src/or)

nickm at seul.org nickm at seul.org
Wed Apr 9 18:24:52 UTC 2008


Author: nickm
Date: 2008-04-09 14:24:50 -0400 (Wed, 09 Apr 2008)
New Revision: 14332

Modified:
   tor/branches/tor-0_2_0-patches/
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/doc/TODO.020
   tor/branches/tor-0_2_0-patches/src/or/routerlist.c
Log:
 r19268 at catbus:  nickm | 2008-04-09 14:20:54 -0400
 Backport 14205: Free authority certificates on exit, so they dont look like memory leaks.



Property changes on: tor/branches/tor-0_2_0-patches
___________________________________________________________________
 svk:merge ticket from /tor/020 [r19268] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-04-09 18:24:48 UTC (rev 14331)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-04-09 18:24:50 UTC (rev 14332)
@@ -11,6 +11,8 @@
     - 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

Modified: tor/branches/tor-0_2_0-patches/doc/TODO.020
===================================================================
--- tor/branches/tor-0_2_0-patches/doc/TODO.020	2008-04-09 18:24:48 UTC (rev 14331)
+++ tor/branches/tor-0_2_0-patches/doc/TODO.020	2008-04-09 18:24:50 UTC (rev 14332)
@@ -4,7 +4,7 @@
 
 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.

Modified: tor/branches/tor-0_2_0-patches/src/or/routerlist.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/routerlist.c	2008-04-09 18:24:48 UTC (rev 14331)
+++ tor/branches/tor-0_2_0-patches/src/or/routerlist.c	2008-04-09 18:24:50 UTC (rev 14332)
@@ -2628,6 +2628,17 @@
     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



More information about the tor-commits mailing list