Skip to content

Commit e21c4d7

Browse files
committed
f278 fix setting heap in wc_SrpInit_ex
1 parent 178f96c commit e21c4d7

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

wolfcrypt/src/srp.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ int wc_SrpInit_ex(Srp* srp, SrpType type, SrpSide side, void* heap, int devId)
259259
/* initializing variables */
260260
XMEMSET(srp, 0, sizeof(Srp));
261261

262+
/* default heap hint to NULL or test value */
263+
#ifdef WOLFSSL_HEAP_TEST
264+
srp->heap = (void*)WOLFSSL_HEAP_TEST;
265+
#else
266+
srp->heap = heap;
267+
#endif /* WOLFSSL_HEAP_TEST */
268+
262269
if ((r = SrpHashInit(&srp->client_proof, type, srp->heap)) != 0)
263270
return r;
264271

@@ -280,13 +287,6 @@ int wc_SrpInit_ex(Srp* srp, SrpType type, SrpSide side, void* heap, int devId)
280287

281288
srp->keyGenFunc_cb = wc_SrpSetKey;
282289

283-
/* default heap hint to NULL or test value */
284-
#ifdef WOLFSSL_HEAP_TEST
285-
srp->heap = (void*)WOLFSSL_HEAP_TEST;
286-
#else
287-
srp->heap = heap;
288-
#endif /* WOLFSSL_HEAP_TEST */
289-
290290
(void)devId; /* future */
291291

292292
return 0;

0 commit comments

Comments
 (0)