Skip to content

Commit 16b8429

Browse files
fix for CID 330416 memory leak
1 parent 449fb9c commit 16b8429

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

wolfcrypt/src/hpke.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,10 @@ static int wc_HpkeEncap(Hpke* hpke, void* ephemeralKey, void* receiverKey,
785785
#ifdef ECC_TIMING_RESISTANT
786786
rng = wc_rng_new(NULL, 0, hpke->heap);
787787

788-
if (rng == NULL)
789-
return RNG_FAILURE_E;
788+
if (rng == NULL) {
789+
ret = RNG_FAILURE_E;
790+
break;
791+
}
790792

791793
wc_ecc_set_rng((ecc_key*)ephemeralKey, rng);
792794
#endif

0 commit comments

Comments
 (0)