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
This commit is contained in:
Nick Mathewson 2007-04-23 23:24:53 +00:00
parent 3831d77dba
commit 94eef608ae

View 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);