f278 fix setting heap in wc_SrpInit_ex

This commit is contained in:
Eric Blankenhorn
2026-03-05 16:11:47 -06:00
parent 178f96c483
commit e21c4d71a6
+7 -7
View File
@@ -259,6 +259,13 @@ int wc_SrpInit_ex(Srp* srp, SrpType type, SrpSide side, void* heap, int devId)
/* initializing variables */
XMEMSET(srp, 0, sizeof(Srp));
/* default heap hint to NULL or test value */
#ifdef WOLFSSL_HEAP_TEST
srp->heap = (void*)WOLFSSL_HEAP_TEST;
#else
srp->heap = heap;
#endif /* WOLFSSL_HEAP_TEST */
if ((r = SrpHashInit(&srp->client_proof, type, srp->heap)) != 0)
return r;
@@ -280,13 +287,6 @@ int wc_SrpInit_ex(Srp* srp, SrpType type, SrpSide side, void* heap, int devId)
srp->keyGenFunc_cb = wc_SrpSetKey;
/* default heap hint to NULL or test value */
#ifdef WOLFSSL_HEAP_TEST
srp->heap = (void*)WOLFSSL_HEAP_TEST;
#else
srp->heap = heap;
#endif /* WOLFSSL_HEAP_TEST */
(void)devId; /* future */
return 0;