dcc: Use spice_new instead of spice_malloc

spice_new return directly the correct type.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-10-18 10:01:08 +01:00
parent da4a0fbe03
commit cd631b5819

View File

@ -177,7 +177,7 @@ static RedSurfaceCreateItem *red_surface_create_item_new(RedChannel* channel,
{
RedSurfaceCreateItem *create;
create = spice_malloc(sizeof(RedSurfaceCreateItem));
create = spice_new(RedSurfaceCreateItem, 1);
create->surface_create.surface_id = surface_id;
create->surface_create.width = width;
@ -692,7 +692,7 @@ static RedSurfaceDestroyItem *red_surface_destroy_item_new(RedChannel *channel,
{
RedSurfaceDestroyItem *destroy;
destroy = spice_malloc(sizeof(RedSurfaceDestroyItem));
destroy = spice_new(RedSurfaceDestroyItem, 1);
destroy->surface_destroy.surface_id = surface_id;
red_pipe_item_init(&destroy->pipe_item, RED_PIPE_ITEM_TYPE_DESTROY_SURFACE);