Skip to content

Commit

Permalink
Merge pull request wolfSSL#7394 from embhorn/zd17779
Browse files Browse the repository at this point in the history
Add null check to wolfSSL_Free
  • Loading branch information
JacobBarthelmeh authored May 16, 2024
2 parents 55ea330 + 4e5a98e commit 2120424
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wolfcrypt/src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,10 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
#endif
}
mem = hint->memory;
if (mem == NULL) {
WOLFSSL_MSG("Bad hint pointer to memory");
return;
}

/* get memory struct and add it to available list */
pt = (wc_Memory*)((byte*)ptr - sizeof(wc_Memory) - padSz);
Expand Down

0 comments on commit 2120424

Please sign in to comment.