diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-06-26 17:40:10 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-06-26 17:40:10 +0200 |
commit | a55fc45126b13de56a76a44f629a73b1eb003408 (patch) | |
tree | e5578ad70737167ea3194d808199f949d256582d /src | |
parent | 9865febb17718a95f6444591ecdc5b09259a556c (diff) | |
download | exchange-a55fc45126b13de56a76a44f629a73b1eb003408.tar.xz |
-fix valgrind complaints
Diffstat (limited to 'src')
-rw-r--r-- | src/exchange/taler-exchange-httpd_refreshes_reveal.c | 4 | ||||
-rw-r--r-- | src/extensions/extension_age_restriction.c | 2 | ||||
-rw-r--r-- | src/extensions/extensions.c | 6 | ||||
-rw-r--r-- | src/include/taler_extensions.h | 2 | ||||
-rw-r--r-- | src/util/age_restriction.c | 1 |
5 files changed, 8 insertions, 7 deletions
diff --git a/src/exchange/taler-exchange-httpd_refreshes_reveal.c b/src/exchange/taler-exchange-httpd_refreshes_reveal.c index 3b75576ce..a0fd83bfa 100644 --- a/src/exchange/taler-exchange-httpd_refreshes_reveal.c +++ b/src/exchange/taler-exchange-httpd_refreshes_reveal.c @@ -259,6 +259,8 @@ check_commitment (struct RevealContext *rctx, const struct TALER_TransferPrivateKeyP *tpriv = &rctx->transfer_privs[i - off]; struct TALER_TransferSecretP ts; + struct TALER_AgeCommitmentHash h = {0}; + struct TALER_AgeCommitmentHash *hac = NULL; GNUNET_CRYPTO_ecdhe_key_get_public (&tpriv->ecdhe_priv, &rce->transfer_pub.ecdhe_pub); @@ -279,7 +281,6 @@ check_commitment (struct RevealContext *rctx, const struct TALER_ExchangeWithdrawValues *alg_value = &rctx->rrcs[j].exchange_vals; struct TALER_PlanchetDetail pd = {0}; - struct TALER_AgeCommitmentHash *hac = NULL; struct TALER_CoinPubHashP c_hash; struct TALER_PlanchetMasterSecretP ps; @@ -303,7 +304,6 @@ check_commitment (struct RevealContext *rctx, .commitment = *(rctx->old_age_commitment) }; struct TALER_AgeCommitmentProof nacp = {0}; - struct TALER_AgeCommitmentHash h = {0}; GNUNET_assert (GNUNET_OK == TALER_age_commitment_derive ( diff --git a/src/extensions/extension_age_restriction.c b/src/extensions/extension_age_restriction.c index 9acc5dcbf..fedf12d44 100644 --- a/src/extensions/extension_age_restriction.c +++ b/src/extensions/extension_age_restriction.c @@ -79,7 +79,7 @@ TALER_parse_age_group_string ( return GNUNET_SYSERR; } - if (0>val || 32<=val || prev>=val) + if (32<=val || prev>=val) return GNUNET_SYSERR; mask->bits |= (1 << val); diff --git a/src/extensions/extensions.c b/src/extensions/extensions.c index 55a7dcd81..0df0bae36 100644 --- a/src/extensions/extensions.c +++ b/src/extensions/extensions.c @@ -38,7 +38,7 @@ TALER_extensions_get_head () enum GNUNET_GenericReturnValue TALER_extensions_add ( - const struct TALER_Extension *extension) + struct TALER_Extension *extension) { /* Sanity checks */ if ((NULL == extension) || @@ -60,10 +60,12 @@ TALER_extensions_add ( else { struct TALER_Extension *iter; + struct TALER_Extension *last; /* Check for collisions */ for (iter = TE_extensions; NULL != iter; iter = iter->next) { + last = iter; if (extension->type == iter->type || 0 == strcasecmp (extension->name, iter->name)) @@ -76,7 +78,7 @@ TALER_extensions_add ( } /* No collisions found, so add this extension to the list */ - iter->next = (struct TALER_Extension *) extension; + last->next = extension; } return GNUNET_OK; diff --git a/src/include/taler_extensions.h b/src/include/taler_extensions.h index 82392a3ea..342faad2a 100644 --- a/src/include/taler_extensions.h +++ b/src/include/taler_extensions.h @@ -123,7 +123,7 @@ TALER_extensions_get_head (); */ enum GNUNET_GenericReturnValue TALER_extensions_add ( - const struct TALER_Extension *new_extension); + struct TALER_Extension *new_extension); /** * Finds and returns a supported extension by a given type. diff --git a/src/util/age_restriction.c b/src/util/age_restriction.c index 0ee020ebd..189ec4e8c 100644 --- a/src/util/age_restriction.c +++ b/src/util/age_restriction.c @@ -96,7 +96,6 @@ TALER_age_restriction_commit ( GNUNET_assert (NULL != seed); GNUNET_assert (NULL != new); GNUNET_assert (mask->bits & 1); /* fist bit must have been set */ - GNUNET_assert (0 <= num_priv); GNUNET_assert (31 > num_priv); GNUNET_assert (num_priv <= num_pub); |