From 94eef608ae367c1b922a0831c979b2ff1f755a4f Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 23 Apr 2007 23:24:53 +0000 Subject: [PATCH] r12784@Kushana: nickm | 2007-04-23 19:24:09 -0400 Avoid another assert failure in the new buffer memory code. (This time, it hit when freeing a 4k buffer with some data on it.) svn:r10011 --- src/or/buffers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/or/buffers.c b/src/or/buffers.c index 1d80f88ea4..26a5b9683c 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -468,6 +468,7 @@ buf_free(buf_t *buf) assert_buf_ok(buf); buf->magic = 0xDEADBEEF; if (buf->len == MIN_LAZY_SHRINK_SIZE) { + buf->datalen = 0; /* Avoid assert in add_buf_mem_to_freelist. */ add_buf_mem_to_freelist(buf); } else if (buf->mem) { oldmem = RAW_MEM(buf->mem);