commit 937065ae9f57fca99e2f9af95e172f400edef8d6
parent 0f5f27e853ad71f721720fef1395d116b0f46ae7
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 29 Mar 2020 01:58:27 +0100
fix leak of old keystate if loading of new keystate failed
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git 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;