Fix for static memory with bucket size matching.

This commit is contained in:
David Garske 2021-08-17 10:38:27 -07:00
parent 69d01afd3a
commit c598688f89
1 changed files with 2 additions and 2 deletions

View File

@ -670,7 +670,7 @@ void* wolfSSL_Malloc(size_t size, void* heap, int type)
/* general static memory */
if (pt == NULL) {
for (i = 0; i < WOLFMEM_MAX_BUCKETS; i++) {
if ((word32)size < mem->sizeList[i]) {
if ((word32)size <= mem->sizeList[i]) {
if (mem->ava[i] != NULL) {
pt = mem->ava[i];
mem->ava[i] = pt->next;
@ -905,7 +905,7 @@ void* wolfSSL_Realloc(void *ptr, size_t size, void* heap, int type)
else {
/* general memory */
for (i = 0; i < WOLFMEM_MAX_BUCKETS; i++) {
if ((word32)size < mem->sizeList[i]) {
if ((word32)size <= mem->sizeList[i]) {
if (mem->ava[i] != NULL) {
pt = mem->ava[i];
mem->ava[i] = pt->next;