Skip to content

Commit 7a98d90

Browse files
Fix heap location.
1 parent 7a3a8d4 commit 7a98d90

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/internal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8642,9 +8642,9 @@ static int BuildUserAuthRequestEcc(WOLFSSH* ssh,
86428642
word32 sSz = ECC_MAX_SIG_SIZE / 2;
86438643
word32 sigSz = ECC_MAX_SIG_SIZE;
86448644
#ifdef WOLFSSH_SMALL_STACK
8645-
r_ptr = (byte*)WMALLOC(rSz, heap, DYNTYPE_BUFFER);
8646-
s_ptr = (byte*)WMALLOC(sSz, heap, DYNTYPE_BUFFER);
8647-
sig_ptr = (byte*)WMALLOC(sigSz, heap, DYNTYPE_BUFFER);
8645+
r_ptr = (byte*)WMALLOC(rSz, ssh->ctx->heap, DYNTYPE_BUFFER);
8646+
s_ptr = (byte*)WMALLOC(sSz, ssh->ctx->heap, DYNTYPE_BUFFER);
8647+
sig_ptr = (byte*)WMALLOC(sigSz, ssh->ctx->heap, DYNTYPE_BUFFER);
86488648
if (r_ptr == NULL || s_ptr == NULL || sig_ptr == NULL)
86498649
ret = WS_MEMORY_E;
86508650
#else
@@ -8775,11 +8775,11 @@ static int BuildUserAuthRequestEcc(WOLFSSH* ssh,
87758775

87768776
#ifdef WOLFSSH_SMALL_STACK
87778777
if (r_ptr)
8778-
WFREE(r_ptr, heap, DYNTYPE_BUFFER);
8778+
WFREE(r_ptr, ssh->ctx->heap, DYNTYPE_BUFFER);
87798779
if (s_ptr)
8780-
WFREE(s_ptr, heap, DYNTYPE_BUFFER);
8780+
WFREE(s_ptr, ssh->ctx->heap, DYNTYPE_BUFFER);
87818781
if (sig_ptr)
8782-
WFREE(sig_ptr, heap, DYNTYPE_BUFFER);
8782+
WFREE(sig_ptr, ssh->ctx->heap, DYNTYPE_BUFFER);
87838783
#endif
87848784
return ret;
87858785
}

0 commit comments

Comments
 (0)