[Spice-devel] [PATCH 19/19] Prevent leak if size from red_get_data_chunks don't match in red_get_image
Frediano Ziglio
fziglio at redhat.com
Tue Oct 6 03:26:03 PDT 2015
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/red_parse_qxl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c
index 3ce4431..dd52602 100644
--- a/server/red_parse_qxl.c
+++ b/server/red_parse_qxl.c
@@ -526,6 +526,7 @@ static SpiceImage *red_get_image(RedMemSlotInfo *slots, int group_id,
&chunks, qxl->bitmap.data);
spice_assert(size == bitmap_size);
if (size != bitmap_size) {
+ red_put_data_chunks(&chunks);
goto error;
}
red->u.bitmap.data = red_get_image_data_chunked(slots, group_id,
@@ -546,6 +547,7 @@ static SpiceImage *red_get_image(RedMemSlotInfo *slots, int group_id,
&chunks, (QXLDataChunk *)qxl->quic.data);
spice_assert(size == red->u.quic.data_size);
if (size != red->u.quic.data_size) {
+ red_put_data_chunks(&chunks);
goto error;
}
red->u.quic.data = red_get_image_data_chunked(slots, group_id,
--
2.4.3
More information about the Spice-devel
mailing list