From 7026fde02f34d8de5251e0967a49e2b6a1ddcabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 4 Feb 2016 08:53:27 +0100 Subject: [PATCH] vtest: fix potential leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found that to american fuzzy lop & AddressSanitizer Signed-off-by: Marc-André Lureau --- vtest/vtest_renderer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index 045193c..575f34e 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -298,11 +298,9 @@ int vtest_transfer_get(uint32_t length_dw) if (ret) fprintf(stderr," transfer read failed %d\n", ret); ret = vtest_block_write(renderer.out_fd, ptr, data_size); - if (ret < 0) - return ret; free(ptr); - return 0; + return ret < 0 ? ret : 0; } int vtest_transfer_put(uint32_t length_dw)