From e0556657526a7fe53d6e17cf70ffa6a8ee35e0a9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 2 Nov 2009 12:35:47 -0700 Subject: [PATCH] glx: Fix memory leak if XF86DRICreateDrawable() fails Signed-off-by: Brian Paul --- src/glx/x11/dri_glx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index ab24bd8ffe1..4f7acb6cc32 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -596,8 +596,10 @@ driCreateDrawable(__GLXscreenConfigs * psc, pdraw->drawable = drawable; pdraw->psc = psc; - if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable)) + if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable)) { + Xfree(pdraw); return NULL; + } /* Create a new drawable */ pdraw->driDrawable = -- 2.30.2