forked from wolfSSL/wolfssl
Merge pull request #2575 from tmael/valgrind_dhtest
Fix memory leak in dh_test
This commit is contained in:
@@ -13071,6 +13071,9 @@ static int dh_test_ffdhe(WC_RNG *rng, const DhParams* params)
|
|||||||
DhKey key;
|
DhKey key;
|
||||||
DhKey key2;
|
DhKey key2;
|
||||||
|
|
||||||
|
XMEMSET(&key, 0, sizeof(DhKey));
|
||||||
|
XMEMSET(&key2, 0, sizeof(DhKey));
|
||||||
|
|
||||||
ret = wc_InitDhKey_ex(&key, HEAP_HINT, devId);
|
ret = wc_InitDhKey_ex(&key, HEAP_HINT, devId);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
ERROR_OUT(-7180, done);
|
ERROR_OUT(-7180, done);
|
||||||
@@ -13128,6 +13131,8 @@ static int dh_test_ffdhe(WC_RNG *rng, const DhParams* params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
wc_FreeDhKey(&key);
|
||||||
|
wc_FreeDhKey(&key2);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user