[or-cvs] [tor/maint-0.2.2] Avoid perma-blocking the controller on bug in shrink_freelist

nickm at torproject.org nickm at torproject.org
Fri Nov 12 18:06:02 UTC 2010


Author: Nick Mathewson <nickm at torproject.org>
Date: Fri, 12 Nov 2010 13:05:58 -0500
Subject: Avoid perma-blocking the controller on bug in shrink_freelist
Commit: dbba84c917279c8c58b1bfdac37fbcdfd84b7bb7

In all likelihood, this bug would make Tor assert, but if it doesn't,
let's not have two bugs.
---
 src/or/buffers.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/or/buffers.c b/src/or/buffers.c
index 7c28dc1..d25ff64 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -283,7 +283,7 @@ buf_shrink_freelists(int free_all)
                    orig_n_to_skip, (int)freelists[i].alloc_size,
                    orig_n_to_skip-n_to_skip, freelists[i].cur_length);
           assert_freelist_ok(&freelists[i]);
-          return;
+          goto done;
         }
         // tor_assert((*chp)->next);
         chp = &(*chp)->next;
@@ -318,6 +318,7 @@ buf_shrink_freelists(int free_all)
     freelists[i].lowest_length = freelists[i].cur_length;
     assert_freelist_ok(&freelists[i]);
   }
+ done:
   enable_control_logging();
 #else
   (void) free_all;
-- 
1.7.1



More information about the tor-commits mailing list