devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e29da3ca694d62f9c0049e1d8d65f8f95e6bf455

commit e29da3ca694d62f9c0049e1d8d65f8f95e6bf455
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Tue Nov 17 10:00:19 2015 -0500

    evas-software-x11: Fix resource leak
    
    If we end up leaving evas_xlib_image_dri_native_set due to a failure
    to allocate memory, we should free the previously allocated
    Evas_DRI_Image so that we don't leak
    
    NB: Fixes Coverity CID1339782
    
    @fix
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/modules/evas/engines/software_x11/evas_xlib_dri_image.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c 
b/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
index 2c1c72c..0c0a0ab 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
@@ -588,7 +588,10 @@ evas_xlib_image_dri_native_set(void *data, void *image, 
void *native)
 
    n = calloc(1, sizeof(DRI_Native));
    if (!n)
-     return NULL;
+     {
+        evas_xlib_image_dri_free(exim);
+        return NULL;
+     }
 
    memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
    n->pixmap = pm;

-- 


Reply via email to