if (inst->handler_tree) {
rbtree_deletebydata(inst->handler_tree, handler);
}
+ /*
+ * Free operations need to be synchronised too.
+ */
+ talloc_free(handler);
PTHREAD_MUTEX_UNLOCK(&(inst->handler_mutex));
return 0;
if (inst->handler_tree) {
rbtree_insert(inst->handler_tree, handler);
}
-
handler->inst_holder = inst;
- talloc_set_destructor(handler, _eap_handler_free);
+
PTHREAD_MUTEX_UNLOCK(&(inst->handler_mutex));
+ talloc_set_destructor(handler, _eap_handler_free);
return handler;
}