]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bugfix on r11298:
authorRoger Dingledine <arma@torproject.org>
Thu, 11 Oct 2007 02:03:53 +0000 (02:03 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 11 Oct 2007 02:03:53 +0000 (02:03 +0000)
Fix a minor memory leak whenever we parse guards from our state
file. Bugfix on 0.2.0.7-alpha.

svn:r11862

ChangeLog
src/common/util.c
src/or/circuitbuild.c

index 0f2892268585be24b05727136db58daa3cabf7dc..7c36d620f8010900e1f13b3117a966a2480ce2cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -91,6 +91,8 @@ Changes in version 0.2.0.8-alpha - 2007-10-12
   o Minor bugfixes (of some sort):
     - Stop calling tor_strlower() on uninitialized memory in some cases.
       Bugfix in 0.2.0.7-alpha.
+    - Fix a minor memory leak whenever we parse guards from our state
+      file. Bugfix on 0.2.0.7-alpha.
 
   o Code simplifications and refactoring:
     - Make a bunch of functions static.  Remove some dead code.
index 701256a9ada8a4a01cfcca717fd0f4435867c9bd..6786fd749e5e728f19a3dca927396e6a80e13e3f 100644 (file)
@@ -1530,8 +1530,8 @@ struct open_file_t {
 /** Try to start writing to the file in <b>fname</b>, passing the flags
  * <b>open_flags</b> to the open() syscall, creating the file (if needed) with
  * access value <b>mode</b>.  If the O_APPEND flag is set, we append to the
- * original file.  Otherwise, we open a new temporary file in the same
- * directory, and either replace the original or remove the temprorary file
+ * original file.  Otherwise, we open a new temporary file in the same
+ * directory, and either replace the original or remove the temporary file
  * when we're done.
  *
  * Return the fd for the newly opened file, and store working data in
index 0db6908f612b12ea59fd41bfaec0c2c65f05f578..53555b215caa8ce9d3aa25ed9b77eb4dd16c2883 100644 (file)
@@ -2404,7 +2404,7 @@ entry_guards_prepend_from_config(void)
   /* Finally, the remaining EntryNodes, unless we're strict */
   if (options->StrictEntryNodes) {
     SMARTLIST_FOREACH(old_entry_guards_not_on_list, entry_guard_t *, e,
-                      tor_free(e));
+                      entry_guard_free(e));
   } else {
     smartlist_add_all(entry_guards, old_entry_guards_not_on_list);
   }
@@ -2641,11 +2641,13 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
    });
 
   if (*msg || !set) {
-    SMARTLIST_FOREACH(new_entry_guards, entry_guard_t *, e, tor_free(e));
+    SMARTLIST_FOREACH(new_entry_guards, entry_guard_t *, e,
+                      entry_guard_free(e));
     smartlist_free(new_entry_guards);
   } else { /* !*err && set */
     if (entry_guards) {
-      SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e, tor_free(e));
+      SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e,
+                        entry_guard_free(e));
       smartlist_free(entry_guards);
     }
     entry_guards = new_entry_guards;