From 52f895df518608321873f53d6f8549bdbaf0059a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 30 Jun 2009 08:27:28 -0600 Subject: glx: fix null pointer dereference segfault (bug 22546) --- src/glx/x11/glxcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glx/x11') diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index 77471b8..820d8b9 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -164,7 +164,7 @@ GetGLXScreenConfigs(Display *dpy, int scrn) { __GLXdisplayPrivate * const priv = __glXInitialize(dpy); - return (priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL; + return (priv && priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL; } -- cgit v1.1 From fa5b0364f90be19bb0e1915f1eea691d06fb8929 Mon Sep 17 00:00:00 2001 From: Kristof Ralovich Date: Tue, 30 Jun 2009 08:31:18 -0600 Subject: glx: plug a leak Swrast was missing a free for the culmination of driConcatConfigs. Use free(), not _mesa_free() since we shouldn't be calling any Mesa functions from the GLX code. driConcatConfigs() should probably use regular malloc/free to be consistant but the Mesa functions just wrap the libc functions anyway. --- src/glx/x11/drisw_glx.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/glx/x11') diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c index b843ce4..1c229dd 100644 --- a/src/glx/x11/drisw_glx.c +++ b/src/glx/x11/drisw_glx.c @@ -401,6 +401,8 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen, psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + free(driver_configs); + psp->destroyScreen = driDestroyScreen; psp->createContext = driCreateContext; psp->createDrawable = driCreateDrawable; -- cgit v1.1