Same fix for eap session and handler trees
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 21 Jun 2014 15:26:01 +0000 (17:26 +0200)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 21 Jun 2014 15:26:09 +0000 (17:26 +0200)
src/modules/rlm_eap/rlm_eap.c

index 831e01e..b3ff531 100644 (file)
@@ -226,18 +226,20 @@ static int mod_instantiate(CONF_SECTION *cs, void *instance)
         *      Lookup sessions in the tree.  We don't free them in
         *      the tree, as that's taken care of elsewhere...
         */
-       inst->session_tree = rbtree_create(inst, eap_handler_cmp, NULL, 0);
+       inst->session_tree = rbtree_create(NULL, eap_handler_cmp, NULL, 0);
        if (!inst->session_tree) {
                ERROR("rlm_eap (%s): Cannot initialize tree", inst->xlat_name);
                return -1;
        }
+       fr_link_talloc_ctx_free(inst, inst->session_tree);
 
        if (fr_debug_flag) {
-               inst->handler_tree = rbtree_create(inst, eap_handler_ptr_cmp, NULL, 0);
+               inst->handler_tree = rbtree_create(NULL, eap_handler_ptr_cmp, NULL, 0);
                if (!inst->handler_tree) {
                        ERROR("rlm_eap (%s): Cannot initialize tree", inst->xlat_name);
                        return -1;
                }
+               fr_link_talloc_ctx_free(inst, inst->handler_tree);
 
 #ifdef HAVE_PTHREAD_H
                if (pthread_mutex_init(&(inst->handler_mutex), NULL) < 0) {