From 1edf354bf86d891a9b21be777e182738d767c006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 18 Jan 2016 23:11:10 +0100 Subject: [PATCH] vtest: fix some leaks on error 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 8ea75ca..d5d24df 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -168,11 +168,13 @@ int vtest_send_caps(void) hdr_buf[1] = 1; ret = vtest_block_write(renderer.out_fd, hdr_buf, 8); if (ret < 0) - return ret; + goto end; vtest_block_write(renderer.out_fd, caps_buf, max_size); if (ret < 0) - return ret; + goto end; +end: + free(caps_buf); return 0; }