diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-02-04 08:53:27 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-02-10 12:39:48 +1000 |
commit | 7026fde02f34d8de5251e0967a49e2b6a1ddcabe (patch) | |
tree | 684e85ac3a980d7b5adcf0df9286c9be1eacebff /vtest | |
parent | 64c946958737eef1e3c113775483bd4073a05299 (diff) |
vtest: fix potential leak
Found that to american fuzzy lop & AddressSanitizer
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'vtest')
-rw-r--r-- | vtest/vtest_renderer.c | 4 |
1 files changed, 1 insertions, 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) |