-fix valgrind complaints

This commit is contained in:
Özgür Kesim 2022-06-26 17:40:10 +02:00
parent 9865febb17
commit a55fc45126
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7
5 changed files with 8 additions and 7 deletions

View File

@ -259,6 +259,8 @@ check_commitment (struct RevealContext *rctx,
const struct TALER_TransferPrivateKeyP *tpriv const struct TALER_TransferPrivateKeyP *tpriv
= &rctx->transfer_privs[i - off]; = &rctx->transfer_privs[i - off];
struct TALER_TransferSecretP ts; struct TALER_TransferSecretP ts;
struct TALER_AgeCommitmentHash h = {0};
struct TALER_AgeCommitmentHash *hac = NULL;
GNUNET_CRYPTO_ecdhe_key_get_public (&tpriv->ecdhe_priv, GNUNET_CRYPTO_ecdhe_key_get_public (&tpriv->ecdhe_priv,
&rce->transfer_pub.ecdhe_pub); &rce->transfer_pub.ecdhe_pub);
@ -279,7 +281,6 @@ check_commitment (struct RevealContext *rctx,
const struct TALER_ExchangeWithdrawValues *alg_value const struct TALER_ExchangeWithdrawValues *alg_value
= &rctx->rrcs[j].exchange_vals; = &rctx->rrcs[j].exchange_vals;
struct TALER_PlanchetDetail pd = {0}; struct TALER_PlanchetDetail pd = {0};
struct TALER_AgeCommitmentHash *hac = NULL;
struct TALER_CoinPubHashP c_hash; struct TALER_CoinPubHashP c_hash;
struct TALER_PlanchetMasterSecretP ps; struct TALER_PlanchetMasterSecretP ps;
@ -303,7 +304,6 @@ check_commitment (struct RevealContext *rctx,
.commitment = *(rctx->old_age_commitment) .commitment = *(rctx->old_age_commitment)
}; };
struct TALER_AgeCommitmentProof nacp = {0}; struct TALER_AgeCommitmentProof nacp = {0};
struct TALER_AgeCommitmentHash h = {0};
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
TALER_age_commitment_derive ( TALER_age_commitment_derive (

View File

@ -79,7 +79,7 @@ TALER_parse_age_group_string (
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
if (0>val || 32<=val || prev>=val) if (32<=val || prev>=val)
return GNUNET_SYSERR; return GNUNET_SYSERR;
mask->bits |= (1 << val); mask->bits |= (1 << val);

View File

@ -38,7 +38,7 @@ TALER_extensions_get_head ()
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_extensions_add ( TALER_extensions_add (
const struct TALER_Extension *extension) struct TALER_Extension *extension)
{ {
/* Sanity checks */ /* Sanity checks */
if ((NULL == extension) || if ((NULL == extension) ||
@ -60,10 +60,12 @@ TALER_extensions_add (
else else
{ {
struct TALER_Extension *iter; struct TALER_Extension *iter;
struct TALER_Extension *last;
/* Check for collisions */ /* Check for collisions */
for (iter = TE_extensions; NULL != iter; iter = iter->next) for (iter = TE_extensions; NULL != iter; iter = iter->next)
{ {
last = iter;
if (extension->type == iter->type || if (extension->type == iter->type ||
0 == strcasecmp (extension->name, 0 == strcasecmp (extension->name,
iter->name)) iter->name))
@ -76,7 +78,7 @@ TALER_extensions_add (
} }
/* No collisions found, so add this extension to the list */ /* No collisions found, so add this extension to the list */
iter->next = (struct TALER_Extension *) extension; last->next = extension;
} }
return GNUNET_OK; return GNUNET_OK;

View File

@ -123,7 +123,7 @@ TALER_extensions_get_head ();
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_extensions_add ( TALER_extensions_add (
const struct TALER_Extension *new_extension); struct TALER_Extension *new_extension);
/** /**
* Finds and returns a supported extension by a given type. * Finds and returns a supported extension by a given type.

View File

@ -96,7 +96,6 @@ TALER_age_restriction_commit (
GNUNET_assert (NULL != seed); GNUNET_assert (NULL != seed);
GNUNET_assert (NULL != new); GNUNET_assert (NULL != new);
GNUNET_assert (mask->bits & 1); /* fist bit must have been set */ GNUNET_assert (mask->bits & 1); /* fist bit must have been set */
GNUNET_assert (0 <= num_priv);
GNUNET_assert (31 > num_priv); GNUNET_assert (31 > num_priv);
GNUNET_assert (num_priv <= num_pub); GNUNET_assert (num_priv <= num_pub);