diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-07-10 10:23:52 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-07-10 10:23:52 +0200 |
commit | 3024dc9fa54e8677b4816e56f8d215556a7d5561 (patch) | |
tree | aaf2281e1c69327d4b91565d3b75c0a6fa36165a /src/include/taler_crypto_lib.h | |
parent | 9d706a01a23e36e1c349d06e7a1be8bb44b7f0d5 (diff) | |
download | exchange-3024dc9fa54e8677b4816e56f8d215556a7d5561.tar.xz |
fix memory leaks reported by valgrind
Diffstat (limited to 'src/include/taler_crypto_lib.h')
-rw-r--r-- | src/include/taler_crypto_lib.h | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 3ad441cb9..373fc5c22 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -5947,34 +5947,55 @@ TALER_age_commitment_verify ( /** * @brief helper function to free memory of a struct TALER_AgeCommitment * - * @param p the commitment from which all memory should be freed. + * @param ac the commitment from which all memory should be freed. */ void TALER_age_commitment_free ( - struct TALER_AgeCommitment *p); + struct TALER_AgeCommitment *ac); /** * @brief helper function to free memory of a struct TALER_AgeProof * - * @param p the proof of commitment from which all memory should be freed. + * @param ap the proof of commitment from which all memory should be freed. */ void TALER_age_proof_free ( - struct TALER_AgeProof *p); + struct TALER_AgeProof *ap); /** * @brief helper function to free memory of a struct TALER_AgeCommitmentProof * - * @param p the commitment and its proof from which all memory should be freed. + * @param acp the commitment and its proof from which all memory should be freed. */ void TALER_age_commitment_proof_free ( - struct TALER_AgeCommitmentProof *p); + struct TALER_AgeCommitmentProof *acp); /** + * @brief helper function to allocate and copy a struct TALER_AgeCommitmentProof + * + * @param[in] acp The original age commitment proof + * @return The deep copy of @e acp, allocated + */ +struct TALER_AgeCommitmentProof * +TALER_age_commitment_proof_duplicate ( + const struct TALER_AgeCommitmentProof *acp); + +/** + * @brief helper function to copy a struct TALER_AgeCommitmentProof + * + * @param[in] acp The original age commitment proof + * @param[out] nacp The struct to copy the data into, with freshly allocated and copied keys. + */ +void +TALER_age_commitment_proof_deep_copy ( + const struct TALER_AgeCommitmentProof *acp, + struct TALER_AgeCommitmentProof *nacp); + +/** * @brief For age-withdraw, clients have to prove that the public keys for all * age groups larger than the allowed maximum age group are derived by scalar * multiplication from this Edx25519 public key (in Crockford Base32 encoding): |