From 602e68705ebdb0963ee4643aa4098f58cbf98b45 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Mon, 18 Jan 2016 23:01:12 +0100 Subject: vtest: fix vtestname leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix leaks found thanks to AddressSanitizer. Signed-off-by: Marc-André Lureau --- vtest/vtest_renderer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'vtest') diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index 2799544..28eb2fa 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -109,9 +109,15 @@ int vtest_create_renderer(int fd, uint32_t length) return -1; ret = vtest_block_read(renderer.remote_fd, vtestname, length); - if (ret != length) - return -1; + if (ret != length) { + ret = -1; + goto end; + } + ret = virgl_renderer_context_create(ctx_id, strlen(vtestname), vtestname); + +end: + free(vtestname); return ret; } -- cgit v1.2.3