- if (_src != NULL) {
- media_storage_s *_dst = (media_storage_s*)calloc(1, sizeof(media_storage_s));
- media_content_retvm_if(_dst == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-
- if (STRING_VALID(_src->storage_id)) {
- _dst->storage_id = strdup(_src->storage_id);
- if (_dst->storage_id == NULL) {
- media_storage_destroy((media_storage_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->storage_path)) {
- _dst->storage_path = strdup(_src->storage_path);
- if (_dst->storage_path == NULL) {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- media_storage_destroy((media_storage_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- _dst->storage_type = _src->storage_type;
-
- *dst = (media_storage_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;
- }