Allocate bytes divisible by 4KiB when expanding buffer

This commit is contained in:
Tatsuhiro Tsujikawa 2012-02-16 22:54:08 +09:00
parent 61cfa3b9f8
commit 7a6bf8e5cc
1 changed files with 1 additions and 0 deletions

View File

@ -57,6 +57,7 @@ int spdylay_reserve_buffer(uint8_t **buf_ptr, size_t *buflen_ptr,
size_t min_length)
{
if(min_length > *buflen_ptr) {
min_length = (min_length+4095)/4096*4096;
uint8_t *temp = malloc(min_length);
if(temp == NULL) {
return SPDYLAY_ERR_NOMEM;