From: Emil Velikov Date: Thu, 8 May 2014 15:49:45 +0000 (+0100) Subject: egl_dri2: cleanup memory leak in dri2_create_context() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3e78bab7fdc906bf2f4850094885b59ca3c6d08;p=mesa.git egl_dri2: cleanup memory leak in dri2_create_context() Signed-off-by: Emil Velikov Reviewed-by: Kristian Høgsberg Reviewed-by: Chad Versace --- diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 380bd7b095e..a5f71edb984 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: