free(data);
}
-/*
- * Detach the module.
- */
-static int mschapv2_detach(void *arg)
-{
- rlm_eap_mschapv2_t *inst = (rlm_eap_mschapv2_t *) arg;
-
- free(inst);
-
- return 0;
-}
-
/*
* Attach the module.
{
rlm_eap_mschapv2_t *inst;
- inst = malloc(sizeof(*inst));
- if (!inst) {
- radlog(L_ERR, "rlm_eap_mschapv2: out of memory");
- return -1;
- }
- memset(inst, 0, sizeof(*inst));
+ *instance = inst = talloc_zero(cs, rlm_eap_mschapv2_t);
+ if (!inst) return -1;
/*
* Parse the configuration attributes.
*/
if (cf_section_parse(cs, inst, module_config) < 0) {
- mschapv2_detach(inst);
return -1;
}
- *instance = inst;
-
return 0;
}
mschapv2_initiate, /* Start the initial request */
NULL, /* authorization */
mschapv2_authenticate, /* authentication */
- mschapv2_detach /* detach */
+ NULL /* detach */
};