egl_dri2: cleanup memory leak in dri2_create_context()
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 8 May 2014 15:49:45 +0000 (16:49 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 10 May 2014 01:09:02 +0000 (02:09 +0100)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/egl/drivers/dri2/egl_dri2.c

index 380bd7b095ea1ea38caf4ec123d8adffadf9d019..a5f71edb98406b776d741158683fc85dcd04b8fc 100644 (file)
@@ -811,8 +811,9 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
          api = __DRI_API_GLES3;
          break;
       default:
-        _eglError(EGL_BAD_PARAMETER, "eglCreateContext");
-        return NULL;
+         _eglError(EGL_BAD_PARAMETER, "eglCreateContext");
+         free(dri2_ctx);
+         return NULL;
       }
       break;
    case EGL_OPENGL_API: