mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
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:
parent
2f4784cbd8
commit
3831d77dba
@ -469,7 +469,7 @@ buf_free(buf_t *buf)
|
|||||||
buf->magic = 0xDEADBEEF;
|
buf->magic = 0xDEADBEEF;
|
||||||
if (buf->len == MIN_LAZY_SHRINK_SIZE) {
|
if (buf->len == MIN_LAZY_SHRINK_SIZE) {
|
||||||
add_buf_mem_to_freelist(buf);
|
add_buf_mem_to_freelist(buf);
|
||||||
} else {
|
} else if (buf->mem) {
|
||||||
oldmem = RAW_MEM(buf->mem);
|
oldmem = RAW_MEM(buf->mem);
|
||||||
tor_free(oldmem);
|
tor_free(oldmem);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user