- if (_folder != NULL && STRING_VALID(name) && name[0] != '.') {
- if (STRING_VALID(_folder->path) && STRING_VALID(_folder->name)) {
- char *folder_path = NULL;
- char new_folder_path[MAX_PATH_LEN] = {0,};
- char repl_path[MAX_PATH_LEN] = {0, };
-
- memset(repl_path, 0, sizeof(repl_path));
- ret = _media_content_replace_path(_folder->path, repl_path);
- content_retvm_if(!STRING_VALID(repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed");
-
- folder_path = g_path_get_dirname(repl_path);
- content_sec_debug("Existed Folder Path : %s", repl_path);
- snprintf(new_folder_path, sizeof(new_folder_path), "%s/%s", folder_path, name);
- content_sec_debug("New Path : %s", new_folder_path);
-
- SAFE_FREE(g_src_path);
- g_src_path = strdup(repl_path);
-
- SAFE_FREE(_folder->path);
- SAFE_FREE(_folder->name);
- SAFE_FREE(folder_path);
-
- _folder->path = strdup(new_folder_path);
- content_retvm_if(_folder->path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- _folder->name = strdup(name);
- content_retvm_if(_folder->name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- } else {
- content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
- } else {
- content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
+ char *folder_path = NULL;
+ char new_folder_path[MAX_PATH_LEN] = {0,};
+ char repl_path[MAX_PATH_LEN] = {0, };
+
+ content_retip_if_fail(folder);
+ content_retip_if_fail(STRING_VALID(name));
+ content_retip_if_fail(name[0] != '.');
+ content_retip_if_fail(STRING_VALID(_folder->path));
+ content_retip_if_fail(STRING_VALID(_folder->name));
+
+ ret = _media_content_replace_path(_folder->path, repl_path);
+ content_retvm_if(!STRING_VALID(repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed");
+
+ folder_path = g_path_get_dirname(repl_path);
+ content_sec_debug("Existed Folder Path : %s", repl_path);
+ snprintf(new_folder_path, sizeof(new_folder_path), "%s/%s", folder_path, name);
+ content_sec_debug("New Path : %s", new_folder_path);
+
+ g_free(g_src_path);
+ g_src_path = g_strdup(repl_path);
+
+ g_free(_folder->path);
+ g_free(_folder->name);
+ g_free(folder_path);
+
+ _folder->path = g_strdup(new_folder_path);
+ _folder->name = g_strdup(name);