summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-08-09 20:51:42 +0200
committerChristian Grothoff <christian@grothoff.org>2018-08-09 20:51:42 +0200
commite3f7083b3eb39ed28eee27b6104a3a508437c929 (patch)
tree214369f070633e4be5011b2c0aa0fa1a18b8b3ce /src/exchange
parentd9474aab0ff6636962ca44dfb90d597203bd98df (diff)
downloadexchange-e3f7083b3eb39ed28eee27b6104a3a508437c929.tar.gz
exchange-e3f7083b3eb39ed28eee27b6104a3a508437c929.tar.bz2
exchange-e3f7083b3eb39ed28eee27b6104a3a508437c929.zip
fix KS state freeing on exit
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd.c1
-rw-r--r--src/exchange/taler-exchange-httpd_keystate.c23
-rw-r--r--src/exchange/taler-exchange-httpd_keystate.h7
3 files changed, 24 insertions, 7 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index e80ee5a72..71e5c8b53 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1046,6 +1046,7 @@ main (int argc,
MHD_stop_daemon (mhd);
break;
}
+ TEH_KS_free ();
TALER_EXCHANGEDB_plugin_unload (TEH_plugin);
TEH_VALIDATION_done ();
return (GNUNET_SYSERR == ret) ? 1 : 0;
diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c
index 987a938fc..4d1f8888f 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -1841,8 +1841,8 @@ TEH_KS_loop (void)
if (0 != pipe (reload_pipe))
{
- fprintf (stderr,
- "Failed to create pipe.\n");
+ GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
+ "pipe");
return GNUNET_SYSERR;
}
sigusr1 = GNUNET_SIGNAL_handler_install (SIGUSR1,
@@ -1915,11 +1915,6 @@ read_again:
break;
}
}
- if (NULL != internal_key_state)
- {
- TEH_KS_release (internal_key_state);
- internal_key_state = NULL;
- }
GNUNET_SIGNAL_handler_uninstall (sigusr1);
GNUNET_SIGNAL_handler_uninstall (sigterm);
GNUNET_SIGNAL_handler_uninstall (sigint);
@@ -1930,6 +1925,20 @@ read_again:
/**
+ * Finally release #internal_key_state.
+ */
+void
+TEH_KS_free ()
+{
+ if (NULL != internal_key_state)
+ {
+ TEH_KS_release (internal_key_state);
+ internal_key_state = NULL;
+ }
+}
+
+
+/**
* Sign the message in @a purpose with the exchange's signing key.
*
* FIXME:
diff --git a/src/exchange/taler-exchange-httpd_keystate.h b/src/exchange/taler-exchange-httpd_keystate.h
index c332182e0..29e8cd50c 100644
--- a/src/exchange/taler-exchange-httpd_keystate.h
+++ b/src/exchange/taler-exchange-httpd_keystate.h
@@ -78,6 +78,13 @@ TEH_KS_release_ (const char *location,
/**
+ * Finally, release #internal_key_state.
+ */
+void
+TEH_KS_free (void);
+
+
+/**
* Denomination key lookups can be for signing of fresh coins
* or to validate signatures on existing coins. As the validity
* periods for a key differ, the caller must specify which