From cb0eef29c8d8b4a275d448a4a87352092efddb30 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Wed, 9 Jul 2014 09:41:40 +0900 Subject: [PATCH] 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 3bd15a21dc..3d9ac62eb0 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,