Coverity detected a resource leak here because we were not freeing the
malloc'd 'obo' variable.
Fixes Coverity CID1382907
Signed-off-by: Chris Michael <cp.michael@samsung.com>
memset(&bo, 0, sizeof(bo));
bo.size = size;
ret = ioctl(drm_fd, DRM_IOCTL_VC4_CREATE_BO, &bo);
- if (ret) return NULL;
+ if (ret)
+ {
+ free(obo);
+ return NULL;
+ }
+
obo->handle = bo.handle;
obo->size = size;
/* First try to allocate an mmapable buffer with O_RDWR,
memset(&cl, 0, sizeof(cl));
cl.handle = bo.handle;
ioctl(drm_fd, DRM_IOCTL_GEM_CLOSE, &cl);
+ free(obo);
return NULL;
}