Increment correctly reference before adding the item to marshaller

When the initial image was sent to the client the reference
was not incremented leading to some user after free.
This regression was introduced in
3bde2e570c
("DCC: remove more init_send_data() arguments").

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-01-04 13:34:43 +00:00
parent 1e1ed93ea7
commit fe6ad8ba11

View File

@ -2005,6 +2005,7 @@ static void red_marshall_image(RedChannelClient *rcc,
spice_marshall_Image(src_bitmap_out, &red_image,
&bitmap_palette_out, &lzplt_palette_out);
red_pipe_item_ref(&item->base);
spice_marshaller_add_by_ref_full(src_bitmap_out, item->data,
bitmap.y * bitmap.stride,
marshaller_unref_pipe_item, item);