devilhorns pushed a commit to branch master.

commit f9348a5015655a55618610ba2978ba258594ec1a
Author: Chris Michael <[email protected]>
Date:   Fri Jun 28 14:23:57 2013 +0100

    Fix klockwork possible memleak report:
    
    If we get an error trying to "make current" an allocated surface, then
    we should free that allocated surface.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/modules/evas/engines/gl_common/evas_gl_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c 
b/src/modules/evas/engines/gl_common/evas_gl_core.c
index d138143..715268b 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -1412,7 +1412,7 @@ evgl_engine_shutdown(void *eng_data)
 void *
 evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
 {
-   EVGL_Surface   *sfc = NULL;
+   EVGL_Surface *sfc = NULL;
    char *s = NULL;
    int direct_override = 0;
 
@@ -1469,7 +1469,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, 
int w, int h)
    if (!_internal_resource_make_current(eng_data, NULL))
      {
         ERR("Error doing an internal resource make current");
-        return 0;
+        goto error;
      }
 
    // Create internal buffers
@@ -1492,7 +1492,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, 
int w, int h)
    if (!evgl_engine->funcs->make_current(eng_data, NULL, NULL, 0))
      {
         ERR("Error doing make_current(NULL, NULL).");
-        return 0;
+        goto error;
      }
 
    // Keep track of all the created surfaces

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to