From 209d5f5c1698aa7933d40f07d2ad124b88ca9f13 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 16 Oct 2020 10:57:27 -0600 Subject: [PATCH] fix heap hint and type --- src/internal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/internal.c b/src/internal.c index 26659e5..dbf38ed 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9213,7 +9213,7 @@ int wolfSSH_CleanPath(WOLFSSH* ssh, char* in) } sz = (long)WSTRLEN(in); - path = (char*)WMALLOC(sz+1, ssh->ctx->heap, DYNTYPE_TEMP); + path = (char*)WMALLOC(sz+1, ssh->ctx->heap, DYNTYPE_PATH); if (path == NULL) { return WS_MEMORY_E; } @@ -9352,13 +9352,13 @@ int wolfSSH_CleanPath(WOLFSSH* ssh, char* in) /* copy result back to 'in' buffer */ if (WSTRLEN(in) < WSTRLEN(path)) { WLOG(WS_LOG_ERROR, "Fatal error cleaning path"); - WFREE(path, ssh->heap, DYNTYPE_TMP); + WFREE(path, ssh->ctx->heap, DYNTYPE_PATH); return WS_BUFFER_E; } sz = WSTRLEN(path); WMEMCPY(in, path, sz); in[sz] = '\0'; - WFREE(path, ssh->heap, DYNTYPE_TMP); + WFREE(path, ssh->ctx->heap, DYNTYPE_PATH); return (int)sz; } #endif /* WOLFSSH_SFTP || WOLFSSH_SCP */