From a3e78bab7fdc906bf2f4850094885b59ca3c6d08 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 8 May 2014 16:49:45 +0100 Subject: [PATCH] egl_dri2: cleanup memory leak in dri2_create_context() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Emil Velikov Reviewed-by: Kristian Høgsberg Reviewed-by: Chad Versace --- src/egl/drivers/dri2/egl_dri2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: -- 2.30.2