r12782@Kushana: nickm | 2007-04-23 18:20:19 -0400

Avoid a segfault when freeing a buffer with size 0.


svn:r10010
This commit is contained in:
Nick Mathewson 2007-04-23 22:20:45 +00:00
parent 2f4784cbd8
commit 3831d77dba

View File

@ -469,7 +469,7 @@ buf_free(buf_t *buf)
buf->magic = 0xDEADBEEF;
if (buf->len == MIN_LAZY_SHRINK_SIZE) {
add_buf_mem_to_freelist(buf);
} else {
} else if (buf->mem) {
oldmem = RAW_MEM(buf->mem);
tor_free(oldmem);
}