do not crash if keystate fails to load

This commit is contained in:
Christian Grothoff 2019-01-10 13:56:49 +01:00
parent 551562701e
commit 34c8dc504b
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -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;