new (std::nothrow) Padding(left, top, right, bottom));
if (ptr == nullptr || ptr->get() == nullptr) {
LOGE("Out-of-memory");
+ if (ptr != nullptr)
+ delete(ptr);
return NOTI_EX_ERROR_OUT_OF_MEMORY;
}
new (std::nothrow) Geometry(x, y, w, h));
if (ptr == nullptr || ptr->get() == nullptr) {
LOGE("Out-of-memory");
+ if (ptr != nullptr)
+ delete ptr;
return NOTI_EX_ERROR_OUT_OF_MEMORY;
}
new (std::nothrow) Style(col, padd, geo));
if (ptr == nullptr || ptr->get() == nullptr) {
LOGE("Out-of-memory");
+ if (ptr != nullptr)
+ delete ptr;
return NOTI_EX_ERROR_OUT_OF_MEMORY;
}
new (std::nothrow) Geometry(*((*p)->GetGeometry())));
if (geo == nullptr || geo->get() == nullptr) {
LOGE("Out-of-memory");
+ if (geo != nullptr)
+ delete geo;
return NOTI_EX_ERROR_OUT_OF_MEMORY;
}
auto* ptr = new (std::nothrow) shared_ptr<Style>(new (std::nothrow) Style(*s));
if (ptr == nullptr || ptr->get() == nullptr) {
LOGE("Out of memory");
+ if (ptr != nullptr)
+ delete ptr;
return NOTI_EX_ERROR_OUT_OF_MEMORY;
}
tmp_list = g_list_find_custom(__uid_list, GINT_TO_POINTER(req_data->uid),
__comp_uid_info_list);
- uid_info = tmp_list->data;
- uid_info->sharing_req_list = g_list_remove(uid_info->sharing_req_list,
- req_data);
+ if (tmp_list != NULL) {
+ uid_info = tmp_list->data;
+ uid_info->sharing_req_list = g_list_remove(
+ uid_info->sharing_req_list, req_data);
+ }
__free_req_info(req_data);
return FALSE;