if (g_manufactureDataCount == 0)
{
g_manufactureDataList = u_arraylist_create();
- OIC_LOG(DEBUG, TAG, "List of manufacture data created");
+ if (!g_manufactureDataList)
+ {
+ OIC_LOG(ERROR, TAG, "List could not be created");
+ return;
+ }
+ OIC_LOG(DEBUG, TAG, "List of manufacture data created");
}
for (int i = 0; i < g_manufactureDataCount; i++)
{
char *str = u_arraylist_get(g_manufactureDataList, i);
- if (!strcmp(uuid, str))
+ if (str && !strcmp(uuid, str))
{
OIC_LOG(DEBUG, TAG, "UUID already set before");
return;
if (g_serviceUuidCount == 0)
{
g_serviceUuidList = u_arraylist_create();
+ if (!g_serviceUuidList)
+ {
+ OIC_LOG(ERROR, TAG, "List could not be created");
+ return;
+ }
+
OIC_LOG(DEBUG, TAG, "List of service uuid created");
}
for (int i = 0; i < g_serviceUuidCount; i++)
{
char *str = u_arraylist_get(g_serviceUuidList, i);
- if (!strcmp(uuid, str))
+ if (str && !strcmp(uuid, str))
{
OIC_LOG(DEBUG, TAG, "UUID already set before");
return;