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 and jefferyq2 committed Jun 9, 2024
1 parent 1aace00 commit 4a813ec
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 4a813ec

Please sign in to comment.