From 80e48ddcf6d5bdc1fc063f28b7af478dae330233 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 9 Sep 2010 08:06:40 -0400 Subject: [PATCH] glx: Fix another use-after-free problem --- src/glx/glx_pbuffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index d1cb66b87ca..34892e8b1a2 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -220,12 +220,14 @@ DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable) { struct glx_display *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable); + XID xid; if (pdraw != NULL) { + xid = pdraw->xDrawable; (*pdraw->destroyDrawable) (pdraw); __glxHashDelete(priv->drawHash, drawable); if (destroy_xdrawable) - XFreePixmap(pdraw->psc->dpy, pdraw->xDrawable); + XFreePixmap(priv->dpy, xid); } } -- 2.30.2