smack = fgets(buf, sizeof(buf), pFile);
fclose(pFile);
} else {
+ SAFE_FREE(session);
media_content_error("current info read failed");
return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
}
-
G_LOCK(cynara_mutex);
result = cynara_check(_cynara, smack, session, c_uid, privilege);
G_UNLOCK(cynara_mutex);
media_content_type_e media_type = 0;
GArray *thumb_list = (GArray *)user_data;
- if (media == NULL)
- {
+ if (media == NULL) {
media_content_debug("NO Item");
return true;
}
media_content_debug("media_type : [%d]", media_type);
media_info_get_thumbnail_path(media, &thumb_path);
- if (STRING_VALID(thumb_path)) {
+ if (STRING_VALID(thumb_path) && STRING_VALID(MEDIA_CONTENT_THUMB_DEFAULT_PATH)) {
if (strncmp(MEDIA_CONTENT_THUMB_DEFAULT_PATH, thumb_path, strlen(MEDIA_CONTENT_THUMB_DEFAULT_PATH)) != 0) {
g_array_append_val(thumb_list, thumb_path);
}
memset(storage_id, 0x00, sizeof(storage_id));
- if (strstr(MEDIA_ROOT_PATH_CLOUD, path) == NULL) {
+ if (STRING_VALID(MEDIA_ROOT_PATH_CLOUD) && (strstr(MEDIA_ROOT_PATH_CLOUD, path) == NULL)) {
bool ignore_file = FALSE;
bool ignore_dir = FALSE;
char *folder_path = NULL;
else
{
/*If root path, Stop Scanning*/
- if((storage_type == MEDIA_SVC_STORAGE_INTERNAL) && (strcmp(search_path, MEDIA_ROOT_PATH_INTERNAL) == 0))
- {
+ if((storage_type == MEDIA_SVC_STORAGE_INTERNAL) && (strcmp(search_path, MEDIA_ROOT_PATH_INTERNAL) == 0)) {
break;
- }
- else if((storage_type == MEDIA_SVC_STORAGE_EXTERNAL) && (strcmp(search_path, MEDIA_ROOT_PATH_SDCARD) == 0))
- {
+ } else if((storage_type == MEDIA_SVC_STORAGE_EXTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_SDCARD)) && (strcmp(search_path, MEDIA_ROOT_PATH_SDCARD) == 0)) {
break;
- }
- else if(storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB)
- {
+ } else if(storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB) {
char *parent_folder_path = NULL;
bool is_root = FALSE;
parent_folder_path = g_path_get_dirname(search_path);
- if (strcmp(search_path, MEDIA_ROOT_PATH_USB) == 0)
+ if (STRING_VALID(MEDIA_ROOT_PATH_USB) && (strcmp(parent_folder_path, MEDIA_ROOT_PATH_USB) == 0))
is_root = TRUE;
SAFE_FREE(parent_folder_path);