/*
* Set up a storage area for instance data
*/
- if ((data = malloc(sizeof(*data))) == NULL)
- return -1;
- memset(data, 0, sizeof(*data));
+ *instance = data = talloc_zero(conf, struct rlm_python_t);
+ if (!data) return -1;
if (python_init() != 0) {
- free(data);
return -1;
}
* fail.
*/
if (cf_section_parse(conf, data, module_config) < 0) {
- free(data);
return -1;
}
#undef A
- *instance = data;
-
/*
* Call the instantiate function. No request. Use the
* return value.
failed:
python_error();
python_instance_clear(data);
- free(data);
return -1;
}
ret = python_function(NULL, data->detach.function, "detach");
python_instance_clear(data);
-
- free(data);
return ret;
}