aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-11-26 12:12:53 -0500
committerChris Michael <cp.michael@samsung.com>2017-11-26 12:12:53 -0500
commit83c292ffc4b32d659a3a795d2f2711c9806cd1b3 (patch)
tree520f5228854a089fb92578ed85f0d7aca68fc28e
parentelm_code: set the color scheme from the default edc. (diff)
downloadefl-83c292ffc4b32d659a3a795d2f2711c9806cd1b3.tar.gz
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>
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_buffer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_buffer.c b/src/lib/ecore_wl2/ecore_wl2_buffer.c
index a8e5bec5cb..0403fd0891 100644
--- a/src/lib/ecore_wl2/ecore_wl2_buffer.c
+++ b/src/lib/ecore_wl2/ecore_wl2_buffer.c
@@ -428,7 +428,12 @@ _vc4_alloc(Buffer_Manager *self EINA_UNUSED, const char *name EINA_UNUSED, int w
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,
@@ -449,6 +454,7 @@ err:
memset(&cl, 0, sizeof(cl));
cl.handle = bo.handle;
ioctl(drm_fd, DRM_IOCTL_GEM_CLOSE, &cl);
+ free(obo);
return NULL;
}