Skip to content

Commit 10020f9

Browse files
committed
Fix minor compile error with WOLFSSL_DEBUG_MEMORY
1 parent dc56e87 commit 10020f9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

wolfcrypt/src/memory.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,14 +1184,13 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
11841184
#endif
11851185
{
11861186
int i;
1187-
wc_Memory* pt = NULL;
11881187

11891188
if (ptr) {
11901189
/* check for testing heap hint was set */
11911190
#ifdef WOLFSSL_HEAP_TEST
11921191
if (heap == (void*)WOLFSSL_HEAP_TEST) {
11931192
#ifdef WOLFSSL_DEBUG_MEMORY
1194-
fprintf(stderr, "[HEAP %p] Free: %p at %s:%u\n", heap, pt, func,
1193+
fprintf(stderr, "[HEAP %p] Free: %p at %s:%u\n", heap, ptr, func,
11951194
line);
11961195
#endif
11971196
return free(ptr); /* native heap */
@@ -1211,7 +1210,7 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
12111210
#endif
12121211
#ifndef WOLFSSL_NO_MALLOC
12131212
#ifdef WOLFSSL_DEBUG_MEMORY
1214-
fprintf(stderr, "[HEAP %p] Free: %p at %s:%u\n", heap, pt, func,
1213+
fprintf(stderr, "[HEAP %p] Free: %p at %s:%u\n", heap, ptr, func,
12151214
line);
12161215
#endif
12171216
#ifdef FREERTOS
@@ -1228,6 +1227,7 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
12281227
else {
12291228
WOLFSSL_HEAP_HINT* hint = (WOLFSSL_HEAP_HINT*)heap;
12301229
WOLFSSL_HEAP* mem;
1230+
wc_Memory* pt;
12311231
word32 padSz = -(int)sizeof(wc_Memory) & (WOLFSSL_STATIC_ALIGN - 1);
12321232

12331233
if (hint == NULL) {
@@ -1323,7 +1323,6 @@ void wolfSSL_Free(void *ptr, void* heap, int type)
13231323
}
13241324

13251325
(void)i;
1326-
(void)pt;
13271326
(void)type;
13281327
}
13291328

0 commit comments

Comments
 (0)