diff --git a/lib/spdylay_helper.c b/lib/spdylay_helper.c index d1bc8bc2..9243886d 100644 --- a/lib/spdylay_helper.c +++ b/lib/spdylay_helper.c @@ -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;