summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-01-18 14:32:30 +0000
committerFrediano Ziglio <fziglio@redhat.com>2016-01-19 14:03:43 +0000
commit28c35857307e94874f3968745bf0797a3408c73c (patch)
treeb2e8fecbfcf1d75240e8d04086167d2763f343d8 /server
parentbb6901e7f7ec6bfe0dfe6f72df79563f8e7fa37c (diff)
tests: remove leaks in test-qxl-parsing
This make happy address sanitizer during make check. Otherwise memory leak detector can keep in and make tests fails. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
Diffstat (limited to 'server')
-rw-r--r--server/tests/test-qxl-parsing.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/tests/test-qxl-parsing.c b/server/tests/test-qxl-parsing.c
index d44289f6..a3b2e6cf 100644
--- a/server/tests/test-qxl-parsing.c
+++ b/server/tests/test-qxl-parsing.c
@@ -65,6 +65,8 @@ int main(int argc, char **argv)
QXLCursor *cursor;
QXLDataChunk *chunks[2];
+ void *surface_mem;
+
memset(&qxl, 0, sizeof(qxl));
qxl.surface_id = 123;
@@ -75,7 +77,8 @@ int main(int argc, char **argv)
qxl.u.surface_create.width = 128;
qxl.u.surface_create.stride = 512;
qxl.u.surface_create.height = 128;
- qxl.u.surface_create.data = to_physical(malloc(0x10000));
+ surface_mem = malloc(0x10000);
+ qxl.u.surface_create.data = to_physical(surface_mem);
if (red_get_surface_cmd(&mem_info, 0, &cmd, to_physical(&qxl)))
failure();
@@ -117,6 +120,7 @@ int main(int argc, char **argv)
if (red_get_cursor_cmd(&mem_info, 0, &red_cursor_cmd, to_physical(&cursor_cmd)))
failure();
+ free(red_cursor_cmd.u.set.shape.data);
free(cursor);
/* a circular list of empty chunks should not be a problems */
@@ -173,5 +177,9 @@ int main(int argc, char **argv)
free(cursor);
free(chunks[0]);
+ free(mem_info.mem_slots[0]);
+ free(mem_info.mem_slots);
+ free(surface_mem);
+
return exit_code;
}