summaryrefslogtreecommitdiff
path: root/vtest
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-01-18 23:01:12 +0100
committerDave Airlie <airlied@redhat.com>2016-02-10 11:58:56 +1000
commit602e68705ebdb0963ee4643aa4098f58cbf98b45 (patch)
treed50478ca5a012d79847e80b2680873f24b1ccab2 /vtest
parente1eef9a7f917c3d16990c2bedbe0fe09f61442b8 (diff)
vtest: fix vtestname leak
Fix leaks found thanks to AddressSanitizer. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'vtest')
-rw-r--r--vtest/vtest_renderer.c10
1 files changed, 8 insertions, 2 deletions
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;
}