From 7a6bf8e5ccdff1920a2ba68d2c507d437273870a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 16 Feb 2012 22:54:08 +0900 Subject: [PATCH] Allocate bytes divisible by 4KiB when expanding buffer --- lib/spdylay_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/spdylay_helper.c b/lib/spdylay_helper.c index d1bc8bc..9243886 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;