const gchar *name = g_path_get_basename(dst);
storage_get_root_directory(STORAGE_TYPE_INTERNAL, &root_path);
copy_folder = g_strconcat(root_path, "/", ".operation_temp", NULL);
+ if (!copy_folder) {
+ fclose(src_f);
+ return -1;
+ }
dst = g_strconcat(copy_folder, "/", name, NULL);
} else if (location == MYFILE_MMC) {
copy_dst = (char *)dst;
const gchar *name = g_path_get_basename(dst);
storage_get_root_directory(STORAGE_TYPE_EXTERNAL, &root_path);
copy_folder = g_strconcat(root_path, "/", ".operation_temp", NULL);
+ if (!copy_folder) {
+ fclose(src_f);
+ return -1;
+ }
dst = g_strconcat(copy_folder, "/", name, NULL);
}
+ if (!dst) {
+ return -1;
+ }
mf_error("===================== copy_dst is [%s], dst is [%s]", copy_dst, dst);
if (copy_folder && !mf_file_exists(copy_folder)) {
mf_mkpath(copy_folder);
}
if (ret == TRUE) {
d_value = last_len - strlen(end);
- utf8_last[d_value] = '\0';
- output = g_strconcat(output, sep, utf8_last, omit, NULL);
+ if (utf8_last) {
+ utf8_last[d_value] = '\0';
+ output = g_strconcat(output, sep, utf8_last, omit, NULL);
+ }
SAFE_FREE_CHAR(temp);
}
} else {
- output = g_strconcat(output, sep, utf8_last, NULL);
+ if (utf8_last) {
+ output = g_strconcat(output, sep, utf8_last, NULL);
+ }
SAFE_FREE_CHAR(temp);
}
} else {
- output = g_strdup(utf8_last);
+ if (utf8_last) {
+ output = g_strdup(utf8_last);
+ }
SAFE_FREE_CHAR(temp);
}
SAFE_FREE_CHAR(utf8_last);
Eina_List *l = storage_list;
storage_info* info = eina_list_data_get(l);
for (; l; l = eina_list_next(l), info = eina_list_data_get(l)) {
- if ((info->type != STORAGE_TYPE_LABEL) && (!strncmp(info->root_path, curr_path, strlen(info->root_path)))) {
+ if (info && (info->type != STORAGE_TYPE_LABEL) && (!strncmp(info->root_path, curr_path, strlen(info->root_path)))) {
return strdup(info->root_name);
}
}
Eina_List *list = NULL;
void *item = NULL;
EINA_LIST_FOREACH(storage_list, list, item) {
+ if (!item) {
+ continue;
+ }
storage_info *info = item;
if ((info->type != STORAGE_TYPE_LABEL) && (!strcmp(info->root_path, fullpath))) {
return info->type;