rem: lt_dlhandle handle=0; struct module_exports* e=0;
add: lt_dlhandle handle; struct module_exports* e;
context: int load_module(char* name){	int ret;	lt_dlhandle handle=0;	struct module_exports* e=0;	char* error_msg;	struct aaa_module* mod;	struct aaa_module** m;		handle=lt_dlopenext(name);	if (handle==0){		LOG(L_CRIT, "ERROR: load_module: failed to load <%s> in <%s>\n",					name, MODULE_SEARCH_PATH);		goto error;	}	/* get module struct */	e=(struct module_exports*)lt_dlsym(handle, "exports");	error_msg=(char*)lt_dlerror();	if (error_msg!=0){		LOG(L_CRIT, "ERROR: load_module: symbol not found <%s>: %s\n",				name, error_msg);		goto error;	}	/* link it in the module list - TODO*/	mod=pkg_malloc(sizeof(struct aaa_module));	if (mod==0){		LOG(L_CRIT, "ERROR: load_module: memory allocation failure\n");		ret=-2;		goto error;	}	mod->path=name;	mod->handle=handle;	mod->exports=e;	mod->next=0;	for (m=&modules; *m; m=&(*m)->next){		if ((*m)->handle==mod->handle){			LOG(L_WARN, "WARNING: load_module: attempting to load the same"					" module twice (%s)\n", mod->path);			goto skip;		}		if (strcmp((*m)->exports->name, e->name)==0){			LOG(L_CRIT, "ERROR: load_module: module name collision for %s\n",					e->name);			ret=-3;			goto error;		}		if ((*m)->exports->appid==e->appid){			LOG(L_CRIT, "ERROR: load_module: 2 modules with the same "					"appid(%d): %s, %s\n",					e->appid, (*m)->exports->name, e->name);			ret=-4;			goto error;		}	}	*m=mod;skip:	return ret;	error:	if(handle) lt_dlclose(handle);	return ret;}