summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-27 05:02:21 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-03-27 05:02:21 +0200
commit646c9ad0611e5320a460206dec4fdfd516dc8f64 (patch)
treea72679d7821a88ad9686f03b92981fe5726fc611 /src/util
parent098d572471786b035e2a8919275ad87a8ba2b720 (diff)
downloadexchange-646c9ad0611e5320a460206dec4fdfd516dc8f64.tar.gz
exchange-646c9ad0611e5320a460206dec4fdfd516dc8f64.tar.bz2
exchange-646c9ad0611e5320a460206dec4fdfd516dc8f64.zip
fix leak
Diffstat (limited to 'src/util')
-rw-r--r--src/util/test_crypto.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c
index 90d5847e2..84c840093 100644
--- a/src/util/test_crypto.c
+++ b/src/util/test_crypto.c
@@ -130,18 +130,17 @@ test_planchets_rsa (uint8_t age)
if (0 < age)
{
struct TALER_AgeCommitmentHash ah = {0};
- struct TALER_AgeCommitmentProof *acp;
uint64_t salt = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
UINT64_MAX);
- acp = GNUNET_new (struct TALER_AgeCommitmentProof);
+ struct TALER_AgeCommitmentProof acp;
GNUNET_assert (GNUNET_OK ==
TALER_age_restriction_commit (&age_mask,
age,
salt,
- acp));
- TALER_age_commitment_hash (&acp->commitment,
+ &acp));
+ TALER_age_commitment_hash (&acp.commitment,
&ah);
ach = &ah;
}
@@ -260,18 +259,16 @@ test_planchets_cs (uint8_t age)
if (0 < age)
{
struct TALER_AgeCommitmentHash ah = {0};
- struct TALER_AgeCommitmentProof *acp;
+ struct TALER_AgeCommitmentProof acp;
uint64_t salt = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
UINT64_MAX);
- acp = GNUNET_new (struct TALER_AgeCommitmentProof);
-
GNUNET_assert (GNUNET_OK ==
TALER_age_restriction_commit (&age_mask,
age,
salt,
- acp));
- TALER_age_commitment_hash (&acp->commitment,
+ &acp));
+ TALER_age_commitment_hash (&acp.commitment,
&ah);
ach = &ah;
}