Fix minor compile error with WOLFSSL_DEBUG_MEMORY

This commit is contained in:
David Garske
2026-05-20 21:21:07 -07:00
parent dc56e87522
commit 10020f9cc9
+3 -4
View File
@@ -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 */
@@ -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
@@ -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) {
@@ -1323,7 +1323,6 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
}
(void)i;
(void)pt;
(void)type;
}