[Mesa-dev] [PATCH] egl_dri2: cleanup memory leak in dri2_create_context()

Kristian Høgsberg krh at bitplanet.net
Thu May 8 11:06:01 PDT 2014


On Thu, May 8, 2014 at 8:49 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> Cc: Kristian Høgsberg <krh at bitplanet.net>
> Cc: Chad Versace <chad.versace at linux.intel.com>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 380bd7b..a5f71ed 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -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:
> --
> 1.9.2
>


More information about the mesa-dev mailing list