}
if (!refresh) {
+ media_svc_retv_del_if(!storage_id, MS_MEDIA_ERR_INTERNAL, content_info);
content_info->storage_uuid = g_strdup(storage_id);
- media_svc_retv_del_if(content_info->storage_uuid == NULL, MS_MEDIA_ERR_INTERNAL, content_info);
-
content_info->media_uuid = __media_info_generate_uuid();
- media_svc_retv_del_if(content_info->media_uuid == NULL, MS_MEDIA_ERR_INTERNAL, content_info);
}
ret = __media_svc_get_mime_type(path, mime_type);
media_svc_retm_if(!content_info, "content info is NULL");
/* Delete media_svc_content_info_s */
- g_free(content_info->media_uuid);
- g_free(content_info->path);
- g_free(content_info->file_name);
- g_free(content_info->mime_type);
- g_free(content_info->thumbnail_path);
- g_free(content_info->storage_uuid);
+ g_clear_pointer(&content_info->media_uuid, g_free);
+ g_clear_pointer(&content_info->path, g_free);
+ g_clear_pointer(&content_info->file_name, g_free);
+ g_clear_pointer(&content_info->mime_type, g_free);
+ g_clear_pointer(&content_info->thumbnail_path, g_free);
+ g_clear_pointer(&content_info->storage_uuid, g_free);
/* Delete media_svc_content_meta_s */
- g_free(content_info->media_meta.title);
- g_free(content_info->media_meta.album);
- g_free(content_info->media_meta.artist);
- g_free(content_info->media_meta.album_artist);
- g_free(content_info->media_meta.genre);
- g_free(content_info->media_meta.year);
- g_free(content_info->media_meta.recorded_date);
- g_free(content_info->media_meta.track_num);
- g_free(content_info->media_meta.datetaken);
+ g_clear_pointer(&content_info->media_meta.title, g_free);
+ g_clear_pointer(&content_info->media_meta.album, g_free);
+ g_clear_pointer(&content_info->media_meta.artist, g_free);
+ g_clear_pointer(&content_info->media_meta.album_artist, g_free);
+ g_clear_pointer(&content_info->media_meta.genre, g_free);
+ g_clear_pointer(&content_info->media_meta.year, g_free);
+ g_clear_pointer(&content_info->media_meta.recorded_date, g_free);
+ g_clear_pointer(&content_info->media_meta.track_num, g_free);
+ g_clear_pointer(&content_info->media_meta.datetaken, g_free);
}
int _media_svc_create_thumbnail(const char *path, char *thumb_path, media_svc_media_type_e media_type, uid_t uid)