aboutsummaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-12-27 03:27:48 +0000
committerNick Mathewson <nickm@torproject.org>2007-12-27 03:27:48 +0000
commit119b4e1edfbaa05a82e2b0e00cf8756db5e47cb9 (patch)
tree6a1c5e7be8d6df2bd27c5dad14ae7e7f7b63e285 /src/or/buffers.c
parent148e2e1c489ca17aaf3fdca00dc425f2b677749c (diff)
downloadtor-119b4e1edfbaa05a82e2b0e00cf8756db5e47cb9.tar.gz
tor-119b4e1edfbaa05a82e2b0e00cf8756db5e47cb9.zip
r17405@catbus: nickm | 2007-12-26 22:27:37 -0500
And clean up an assertion failure. svn:r12993
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c3
1 files changed, 2 insertions, 1 deletions
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]);