jpeg pushed a commit to branch master.

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

commit cb0eef29c8d8b4a275d448a4a87352092efddb30
Author: Jean-Philippe Andre <[email protected]>
Date:   Wed Jul 9 09:41:40 2014 +0900

    Evas gl: Fix potential memleak
    
    Fixes CID 1224765.
    This CID reports a potential memleak in an "assert" situation.
---
 src/modules/evas/engines/gl_common/evas_gl_texture.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c 
b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index 3bd15a2..3d9ac62 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -505,9 +505,6 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, 
RGBA_Image *im)
    lformat = _evas_gl_texture_search_format(im->cache_entry.flags.alpha, 
gc->shared->info.bgra, im->cache_entry.space);
    if (lformat < 0) return NULL;
 
-   tex = evas_gl_common_texture_alloc(gc, im->cache_entry.w, 
im->cache_entry.h, im->cache_entry.flags.alpha);
-   if (!tex) return NULL;
-
    switch (im->cache_entry.space)
      {
       case EVAS_COLORSPACE_ETC1:
@@ -535,6 +532,10 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, 
RGBA_Image *im)
         break;
      }
 
+   tex = evas_gl_common_texture_alloc(gc, im->cache_entry.w, im->cache_entry.h,
+                                      im->cache_entry.flags.alpha);
+   if (!tex) return NULL;
+
    tex->pt = _pool_tex_find(gc, w, h,
                             *matching_format[lformat].intformat,
                             *matching_format[lformat].format,

-- 


Reply via email to