]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r12784@Kushana: nickm | 2007-04-23 19:24:09 -0400
authorNick Mathewson <nickm@torproject.org>
Mon, 23 Apr 2007 23:24:53 +0000 (23:24 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 23 Apr 2007 23:24:53 +0000 (23:24 +0000)
 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

index 1d80f88ea4e4ec384ac5d59383cd6fd9b987c9f3..26a5b9683c32dd1dd439dac4f1252906ae839be8 100644 (file)
@@ -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);