vtest: fix potential leak

Found that to american fuzzy lop & AddressSanitizer

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 64c9469587
commit 7026fde02f
  1. 4
      vtest/vtest_renderer.c

@ -298,11 +298,9 @@ int vtest_transfer_get(uint32_t length_dw)
if (ret) if (ret)
fprintf(stderr," transfer read failed %d\n", ret); fprintf(stderr," transfer read failed %d\n", ret);
ret = vtest_block_write(renderer.out_fd, ptr, data_size); ret = vtest_block_write(renderer.out_fd, ptr, data_size);
if (ret < 0)
return ret;
free(ptr); free(ptr);
return 0; return ret < 0 ? ret : 0;
} }
int vtest_transfer_put(uint32_t length_dw) int vtest_transfer_put(uint32_t length_dw)

Loading…
Cancel
Save