Change-Id: I4795673e189f75c8b294aa85b17352a244ad4da5
{
mmi_fusion_handle *fusion = (mmi_fusion_handle *)calloc(1, sizeof(mmi_fusion_handle));
+ if (!fusion)
+ {
+ LOGE("Failed to alloc fusion handle");
+ return 0;
+ }
+
void *fusion_info = NULL;
mmi_fusion_module *mmi_fusion_module_info = NULL;
if(!fusion_info)
{
LOGE("Failed to dlopen(error :%s, path :%s)!\n", dlerror(), fusion_name);
- return 0;
+ goto err;
}
mmi_fusion_module_info = dlsym(fusion_info, "mmi_fusion_module_info");
err:
if(fusion_info)
dlclose(fusion_info);
+
+ if(fusion)
+ free(fusion);
return 0;
}
}
}
+ closedir(dir);
+
return cnt;
}
{
mmi_provider_handle *provider = (mmi_provider_handle *)calloc(1, sizeof(mmi_provider_handle));
+ if (!provider)
+ {
+ LOGE("Failed to alloc provider handle");
+ return;
+ }
+
void *provider_info = NULL;
mmi_provider_module *mmi_provider_module_info = NULL;
mmi_provider_module_data *provider_module_data = NULL;
if(!provider_info)
{
LOGE("Failed to dlopen(error :%s, path :%s)!\n", dlerror(), provider_name);
- return;
+ goto err;
}
mmi_provider_module_info = dlsym(provider_info, "mmi_provider_module_info");
if(provider_info)
dlclose(provider_info);
+
+ if(provider)
+ free(provider);
return;
}