fix mem leak (free psc->visuals)
authorKristof Ralovich <kristof.ralovich@gmail.com>
Wed, 20 Aug 2008 21:06:09 +0000 (15:06 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 20 Aug 2008 21:33:03 +0000 (15:33 -0600)
src/glx/x11/glxext.c

index 27985e7f40b548f24df11075e25d01e8a6bbb1a7..5844c3f656e5e8b5b231e86b2d8a072a47953367 100644 (file)
@@ -156,12 +156,15 @@ static void FreeScreenConfigs(__GLXdisplayPrivate *priv)
     for (i = 0; i < screens; i++, psc++) {
        if (psc->configs) {
            _gl_context_modes_destroy( psc->configs );
-           if(psc->effectiveGLXexts)
+           if (psc->effectiveGLXexts)
                Xfree(psc->effectiveGLXexts);
-
            psc->configs = NULL;        /* NOTE: just for paranoia */
        }
-       Xfree((char*) psc->serverGLXexts);
+        if (psc->visuals) {
+            _gl_context_modes_destroy( psc->visuals );
+            psc->visuals = NULL;  /* NOTE: just for paranoia */
+        }
+       Xfree((char*) psc->serverGLXexts);
 
 #ifdef GLX_DIRECT_RENDERING
        if (psc->driScreen) {