summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-10-18 10:01:08 +0100
committerFrediano Ziglio <fziglio@redhat.com>2016-10-20 08:25:42 +0100
commitcd631b581971c6ff92d6e98a751c602d2f4113f0 (patch)
treef60c8254994a966d849f5773f416d980b40ad931
parentda4a0fbe03572611eb4a203e1e4208c1a1b0d768 (diff)
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>
-rw-r--r--server/dcc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/dcc.c b/server/dcc.c
index 0080f10e..6aa19779 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -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);