aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-29 01:58:27 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-29 01:58:27 +0100
commit937065ae9f57fca99e2f9af95e172f400edef8d6 (patch)
tree05fb30431c6035bc2c797328780e90bd44791234
parent0f5f27e853ad71f721720fef1395d116b0f46ae7 (diff)
fix leak of old keystate if loading of new keystate failed
-rw-r--r--src/exchange/taler-exchange-httpd_keystate.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c
index 4117c13a0..3e8566338 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -986,6 +986,11 @@ reload_keys_sign_iter (
now.abs_value_us) )
{
/* We use the most recent one, if it is valid now (not just in the near future) */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Found signing key valid until `%s'\n",
+ GNUNET_STRINGS_absolute_time_to_string (
+ GNUNET_TIME_absolute_ntoh (
+ key_state->current_sign_key_issue.issue.end)));
key_state->current_sign_key_issue = *ski;
}
if (0 !=
@@ -1965,10 +1970,12 @@ TEH_KS_acquire_ (struct GNUNET_TIME_Absolute now,
}
if (NULL == internal_key_state)
{
- /* We tried and failed (again) to setup #internal_key_state */
+ /* We tried and failed to setup #internal_key_state */
GNUNET_assert (0 == pthread_mutex_unlock (&internal_key_state_mutex));
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize key state\n");
+ if (NULL != os)
+ ks_free (os);
return NULL;
}
key_state = internal_key_state;