vtest: fix vtestname leak

Fix leaks found thanks to AddressSanitizer.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent e1eef9a7f9
commit 602e68705e
  1. 10
      vtest/vtest_renderer.c

@ -109,9 +109,15 @@ int vtest_create_renderer(int fd, uint32_t length)
return -1; return -1;
ret = vtest_block_read(renderer.remote_fd, vtestname, length); ret = vtest_block_read(renderer.remote_fd, vtestname, length);
if (ret != length) if (ret != length) {
return -1; ret = -1;
goto end;
}
ret = virgl_renderer_context_create(ctx_id, strlen(vtestname), vtestname); ret = virgl_renderer_context_create(ctx_id, strlen(vtestname), vtestname);
end:
free(vtestname);
return ret; return ret;
} }

Loading…
Cancel
Save