mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-08 09:04:33 +00:00
dcc_gl_scanout_item_new: allocate item when needed
Prevents a leak on early return. Found by coverity. Signed-off-by: Uri Lublin <uril@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
42066f03ec
commit
dc6c57668a
@ -571,7 +571,7 @@ static RedSurfaceDestroyItem *red_surface_destroy_item_new(RedChannel *channel,
|
||||
|
||||
RedPipeItem *dcc_gl_scanout_item_new(RedChannelClient *rcc, void *data, int num)
|
||||
{
|
||||
RedGlScanoutUnixItem *item = spice_new(RedGlScanoutUnixItem, 1);
|
||||
RedGlScanoutUnixItem *item;
|
||||
|
||||
/* FIXME: on !unix peer, start streaming with a video codec */
|
||||
if (!reds_stream_is_plain_unix(red_channel_client_get_stream(rcc)) ||
|
||||
@ -581,6 +581,7 @@ RedPipeItem *dcc_gl_scanout_item_new(RedChannelClient *rcc, void *data, int num)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = spice_new(RedGlScanoutUnixItem, 1);
|
||||
red_pipe_item_init(&item->base, RED_PIPE_ITEM_TYPE_GL_SCANOUT);
|
||||
|
||||
return &item->base;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user