}
fr_assert(mi->dl_inst);
+ mi->module = (module_t const *)mi->dl_inst->module->common;
+ if (!mi->module) {
+ ERROR("Missing public structure for \"%s\"", qual_inst_name);
+ talloc_free(mi);
+ return NULL;
+ }
+
/*
* If we're threaded, check if the module is thread-safe.
*
mi->name = talloc_typed_strdup(mi, qual_inst_name);
talloc_free(qual_inst_name); /* Avoid stealing */
- mi->module = (module_t const *)mi->dl_inst->module->common;
- if (!mi->module) {
- ERROR("Missing public structure for \"%s\"", qual_inst_name);
- talloc_free(mi);
- return NULL;
- }
+
mi->number = ml->last_number++;
mi->ml = ml;