From 52fe9d657bd54e622e8b87070c29ac0ffc27c575 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 19 Nov 2021 20:56:53 +0100 Subject: -fix leaks and compiler warnings --- src/util/test_helper_eddsa.c | 1 + src/util/test_helper_rsa.c | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'src/util') diff --git a/src/util/test_helper_eddsa.c b/src/util/test_helper_eddsa.c index 48c14491a..ddc2fc9fc 100644 --- a/src/util/test_helper_eddsa.c +++ b/src/util/test_helper_eddsa.c @@ -118,6 +118,7 @@ key_cb (void *cls, const struct TALER_SecurityModulePublicKeyP *sm_pub, const struct TALER_SecurityModuleSignatureP *sm_sig) { + (void) cls; (void) sm_pub; (void) sm_sig; if (0 == validity_duration.rel_value_us) diff --git a/src/util/test_helper_rsa.c b/src/util/test_helper_rsa.c index c98a678b8..21840eb49 100644 --- a/src/util/test_helper_rsa.c +++ b/src/util/test_helper_rsa.c @@ -98,6 +98,22 @@ struct KeyData static struct KeyData keys[MAX_KEYS]; +/** + * Release memory occupied by #keys. + */ +static void +free_keys (void) +{ + for (unsigned int i = 0; i 0); + num_keys--; + } +} + + /** * Function called with information about available keys for signing. Usually * only called once per key upon connect. Also called again in case a key is @@ -127,6 +143,7 @@ key_cb (void *cls, const struct TALER_SecurityModulePublicKeyP *sm_pub, const struct TALER_SecurityModuleSignatureP *sm_sig) { + (void) cls; (void) sm_pub; (void) sm_sig; GNUNET_log (GNUNET_ERROR_TYPE_INFO, @@ -472,9 +489,6 @@ par_signing (struct GNUNET_CONFIGURATION_Handle *cfg) for (unsigned int i = 0; i 0); - num_keys--; - } GNUNET_CONFIGURATION_destroy (cfg); return ret; } -- cgit v1.2.3