Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions wolfcrypt/src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,14 +1184,13 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
#endif
{
int i;
wc_Memory* pt = NULL;

if (ptr) {
/* check for testing heap hint was set */
#ifdef WOLFSSL_HEAP_TEST
if (heap == (void*)WOLFSSL_HEAP_TEST) {
#ifdef WOLFSSL_DEBUG_MEMORY
fprintf(stderr, "[HEAP %p] Free: %p at %s:%u\n", heap, pt, func,
fprintf(stderr, "[HEAP %p] Free: %p at %s:%u\n", heap, ptr, func,
line);
#endif
return free(ptr); /* native heap */
Expand All @@ -1211,7 +1210,7 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
#endif
#ifndef WOLFSSL_NO_MALLOC
#ifdef WOLFSSL_DEBUG_MEMORY
fprintf(stderr, "[HEAP %p] Free: %p at %s:%u\n", heap, pt, func,
fprintf(stderr, "[HEAP %p] Free: %p at %s:%u\n", heap, ptr, func,
line);
#endif
#ifdef FREERTOS
Expand All @@ -1228,6 +1227,7 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
else {
WOLFSSL_HEAP_HINT* hint = (WOLFSSL_HEAP_HINT*)heap;
WOLFSSL_HEAP* mem;
wc_Memory* pt;
word32 padSz = -(int)sizeof(wc_Memory) & (WOLFSSL_STATIC_ALIGN - 1);

if (hint == NULL) {
Expand Down Expand Up @@ -1316,14 +1316,14 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
}
}
#endif
(void)pt;
#ifndef SINGLE_THREADED
wc_UnLockMutex(&(mem->memory_mutex));
#endif
}
}

(void)i;
(void)pt;
(void)type;
}

Expand Down
Loading