glx: Fix use after free in drisw error path
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 4 Aug 2010 12:57:02 +0000 (08:57 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 4 Aug 2010 12:57:02 +0000 (08:57 -0400)
src/glx/drisw_glx.c

index 66a60430e816a9572bcdcea67bb13cc6f5675ab4..c5b179157b3edaf2f423a39a889c2bf42411335b 100644 (file)
@@ -502,10 +502,9 @@ driCreateScreen(int screen, struct glx_display *priv)
    return &psc->base;
 
  handle_error:
-   Xfree(psc);
-
    if (psc->driver)
       dlclose(psc->driver);
+   Xfree(psc);
 
    ErrorMessageF("reverting to indirect rendering\n");