[mutter/wip/carlosg/coverity-fixes: 5/8] cogl: Plug leak on error path




commit f5f734efd6da4aad7e78e1831d616326af0f3bba
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 24 23:21:31 2021 +0200

    cogl: Plug leak on error path
    
    If we don't pass the gles version check, the gl_extensions string
    is leaked.
    
    CID: #1505846

 cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
index a9c3e7f329..33d28848c3 100644
--- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
+++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
@@ -348,6 +348,7 @@ _cogl_driver_update_features (CoglContext *context,
                        COGL_DRIVER_ERROR,
                        COGL_DRIVER_ERROR_INVALID_VERSION,
                        "OpenGL ES 2.0 or better is required");
+      g_strfreev (gl_extensions);
       return FALSE;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]