[Spice-devel] [PATCH server] coverity: avoid resource leak (82248)
Snir Sheriber
ssheribe at redhat.com
Mon Apr 18 10:18:36 UTC 2016
free data(SpiceChunks) in case of an error
---
server/red-parse-qxl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c
index 18b7ea6..915056a 100644
--- a/server/red-parse-qxl.c
+++ b/server/red-parse-qxl.c
@@ -378,6 +378,7 @@ static SpiceChunks *red_get_image_data_flat(RedMemSlotInfo *slots, int group_id,
data->data_size = size;
data->chunk[0].data = (void*)memslot_get_virt(slots, addr, size, group_id, &error);
if (error) {
+ free(data);
return 0;
}
data->chunk[0].len = size;
--
2.5.5
More information about the Spice-devel
mailing list