[Spice-devel] [PATCH spice-server 10/12] dcc: Use spice_new instead of spice_malloc

Jonathon Jongsma jjongsma at redhat.com
Wed Oct 19 21:20:51 UTC 2016


Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


On Tue, 2016-10-18 at 10:09 +0100, Frediano Ziglio wrote:
> spice_new return directly the correct type.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/dcc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/server/dcc.c b/server/dcc.c
> index 45ba81b..9bd1c0a 100644
> --- a/server/dcc.c
> +++ b/server/dcc.c
> @@ -176,7 +176,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;
> @@ -691,7 +691,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);
>  


More information about the Spice-devel mailing list