Fix Memory Leak 65/145365/1 accepted/tizen/unified/20170901.025913 submit/tizen/20170822.064852
authorMoonhee Choi <mh0310.choi@samsung.com>
Tue, 22 Aug 2017 06:16:25 +0000 (15:16 +0900)
committerMoonhee Choi <mh0310.choi@samsung.com>
Tue, 22 Aug 2017 06:16:25 +0000 (15:16 +0900)
 - missing free on string buffer

Change-Id: I2599c7cd36444cd89f052b80ed9e71ebbea2f7e5
Signed-off-by: Moonhee Choi <mh0310.choi@samsung.com>
src/cairo-evas-gl-context.c

index 433aafd..aa463ee 100755 (executable)
@@ -277,6 +277,8 @@ cairo_evas_gl_device_create (Evas_GL *evas_gl,
     Evas_GL_Config *evas_cfg;
     cairo_evas_gl_context_t *ctx;
     cairo_status_t status;
+    const char* str = NULL;
+
 
        if (! evas_gl ||! evas_context) {
                fprintf (stderr, "cairo_evas_gl_device_create(): evas_gl or evas_context is NULL\n");
@@ -333,12 +335,16 @@ cairo_evas_gl_device_create (Evas_GL *evas_gl,
        return _cairo_gl_context_create_in_error (status);
     }
 
-    if (strstr(evas_gl_string_query (ctx->evas_gl, EVAS_GL_EXTENSIONS),
-                                    "GLX_MESA_multithread_makecurrent"))
+    str = evas_gl_string_query (ctx->evas_gl, EVAS_GL_EXTENSIONS);
+
+    if (str && strstr(str, "GLX_MESA_multithread_makecurrent"))
        ctx->has_multithread_makecurrent = TRUE;
     else
        ctx->has_multithread_makecurrent = FALSE;
 
+    if (str)
+       free (str);
+
     // reset vbo_size
     ctx->base.vbo_size = 16 * 1024;