From 0f01f30fb29285eb8073464a64fc2fb9a7b3d191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 21 Jan 2016 15:32:28 +0100 Subject: [PATCH] vtest: fix simple potential leaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found thanks to llvm scan-build. Signed-off-by: Marc-André Lureau --- vtest/vtest_renderer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index d5d24df..a4eba32 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -233,8 +233,10 @@ int vtest_submit_cmd(uint32_t length_dw) return -1; ret = vtest_block_read(renderer.in_fd, cbuf, length_dw * 4); - if (ret != length_dw * 4) - return -1; + if (ret != length_dw * 4) { + free(cbuf); + return -1; + } virgl_renderer_submit_cmd(cbuf, ctx_id, length_dw);