try to fix mess for keystate locking

This commit is contained in:
Christian Grothoff 2020-01-19 17:14:14 +01:00
parent b6543b8f9a
commit 9031f7340d
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -2291,6 +2291,7 @@ TEH_KS_init (void)
if (NULL == internal_key_state)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to setup initial key state. This exchange cannot work.\n");
internal_key_state->refcnt = 1;
}
@ -2307,7 +2308,7 @@ TEH_KS_free ()
ks = internal_key_state;
if (NULL == ks)
return;
GNUNET_assert (0 < ks->refcnt);
GNUNET_assert (1 == ks->refcnt);
ks->refcnt--;
ks_free (ks);
}