- if (_src != NULL) {
- media_folder_s *_dst = (media_folder_s*)calloc(1, sizeof(media_folder_s));
- media_content_retvm_if(_dst == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-
- if (STRING_VALID(_src->folder_id)) {
- _dst->folder_id = strdup(_src->folder_id);
- if (_dst->folder_id == NULL) {
- SAFE_FREE(_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (STRING_VALID(_src->parent_folder_id)) {
- _dst->parent_folder_id = strdup(_src->parent_folder_id);
- if (_dst->parent_folder_id == NULL) {
- media_folder_destroy((media_folder_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (STRING_VALID(_src->name)) {
- _dst->name = strdup(_src->name);
- if (_dst->name == NULL) {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- media_folder_destroy((media_folder_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (STRING_VALID(_src->path)) {
- _dst->path = strdup(_src->path);
- if (_dst->path == NULL) {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- media_folder_destroy((media_folder_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (STRING_VALID(_src->storage_uuid)) {
- _dst->storage_uuid = strdup(_src->storage_uuid);
- if (_dst->storage_uuid == NULL) {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- media_folder_destroy((media_folder_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- _dst->storage_type = _src->storage_type;
- _dst->modified_time = _src->modified_time;
- _dst->folder_order = _src->folder_order;
-
- *dst = (media_folder_h)_dst;
-
- ret = MEDIA_CONTENT_ERROR_NONE;
- } else {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }