From 119b4e1edfbaa05a82e2b0e00cf8756db5e47cb9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 27 Dec 2007 03:27:48 +0000 Subject: [PATCH] r17405@catbus: nickm | 2007-12-26 22:27:37 -0500 And clean up an assertion failure. svn:r12993 --- src/or/buffers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/or/buffers.c b/src/or/buffers.c index f8c19087a8..9ee3cfe8dc 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -229,6 +229,7 @@ buf_shrink_freelists(int free_all) int n_to_free = free_all ? freelists[i].cur_length : (freelists[i].lowest_length - slack); int n_to_skip = freelists[i].cur_length - n_to_free; + int new_length = n_to_skip; chunk_t **chp = &freelists[i].head; chunk_t *chunk; log_info(LD_MM, "Cleaning freelist for %d-byte chunks: keeping %d, " @@ -248,7 +249,7 @@ buf_shrink_freelists(int free_all) --n_to_free; } tor_assert(!n_to_free); - freelists[i].cur_length = n_to_skip; + freelists[i].cur_length = new_length; } freelists[i].lowest_length = freelists[i].cur_length; assert_freelist_ok(&freelists[i]);