forked from enlightenment/efl
ecore-wl2: Fix resource leak
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>
This commit is contained in:
parent
5abeeb980a
commit
83c292ffc4
|
@ -428,7 +428,12 @@ _vc4_alloc(Buffer_Manager *self EINA_UNUSED, const char *name EINA_UNUSED, int w
|
||||||
memset(&bo, 0, sizeof(bo));
|
memset(&bo, 0, sizeof(bo));
|
||||||
bo.size = size;
|
bo.size = size;
|
||||||
ret = ioctl(drm_fd, DRM_IOCTL_VC4_CREATE_BO, &bo);
|
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->handle = bo.handle;
|
||||||
obo->size = size;
|
obo->size = size;
|
||||||
/* First try to allocate an mmapable buffer with O_RDWR,
|
/* First try to allocate an mmapable buffer with O_RDWR,
|
||||||
|
@ -449,6 +454,7 @@ err:
|
||||||
memset(&cl, 0, sizeof(cl));
|
memset(&cl, 0, sizeof(cl));
|
||||||
cl.handle = bo.handle;
|
cl.handle = bo.handle;
|
||||||
ioctl(drm_fd, DRM_IOCTL_GEM_CLOSE, &cl);
|
ioctl(drm_fd, DRM_IOCTL_GEM_CLOSE, &cl);
|
||||||
|
free(obo);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue