commit 34c8dc504bf60371db258d3b19353e725d23b1bb
parent 551562701e1f48712a0143d0d152b518342f0883
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 10 Jan 2019 13:56:49 +0100
do not crash if keystate fails to load
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c
@@ -1685,6 +1685,12 @@ TEH_KS_acquire_ (const char *location)
{
internal_key_state = make_fresh_key_state ();
/* bump RC by 1 if we released internal_key_state above */
+ if (NULL == internal_key_state)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to initialize key state\n");
+ return NULL;
+ }
internal_key_state->refcnt += rcd;
}
key_state = internal_key_state;