Possible race condition in command cleanup due to linking order, (Fixes #136)

This commit is contained in:
Jeremy Lakeman 2018-04-16 09:36:17 +09:30
parent 39f582ccab
commit 9ba27b28a0
2 changed files with 1 additions and 10 deletions

View File

@ -2247,4 +2247,5 @@ static void keyring_on_cmd_cleanup()
{
keyring_free(keyring);
keyring = NULL;
free_subscribers();
}

View File

@ -143,16 +143,6 @@ void free_subscribers()
tree_walk(&root, NULL, 0, free_node, NULL);
}
/* Free the subscribers tree after every CLI command.
*/
static void subscriber_on_cmd_cleanup();
DEFINE_TRIGGER(cmd_cleanup, subscriber_on_cmd_cleanup);
static void subscriber_on_cmd_cleanup()
{
free_subscribers();
}
static void *create_subscriber(void *UNUSED(context), const uint8_t *binary, size_t bin_length)
{
assert(bin_length == SID_SIZE);