fix for CID 330416 memory leak

This commit is contained in:
JacobBarthelmeh 2023-10-27 13:27:30 -06:00
parent 449fb9c581
commit 16b842992d

View File

@ -785,8 +785,10 @@ static int wc_HpkeEncap(Hpke* hpke, void* ephemeralKey, void* receiverKey,
#ifdef ECC_TIMING_RESISTANT
rng = wc_rng_new(NULL, 0, hpke->heap);
if (rng == NULL)
return RNG_FAILURE_E;
if (rng == NULL) {
ret = RNG_FAILURE_E;
break;
}
wc_ecc_set_rng((ecc_key*)ephemeralKey, rng);
#endif