renderer: fix a leak in resource attach

Just return if the resource has been attached a iov
to avoid memory leak.

Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Li Qiang 8 years ago committed by Dave Airlie
parent b7fd972793
commit 40b0e78133
  1. 3
      src/vrend_renderer.c

@ -4031,6 +4031,9 @@ int vrend_renderer_resource_attach_iov(int res_handle, struct iovec *iov,
if (!res)
return EINVAL;
if (res->iov)
return 0;
/* work out size and max resource size */
res->iov = iov;
res->num_iovs = num_iovs;

Loading…
Cancel
Save