glx: replace Xmalloc() calls with Xcalloc()
authorBrian Paul <brianp@vmware.com>
Mon, 4 May 2009 13:52:55 +0000 (07:52 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 4 May 2009 13:52:55 +0000 (07:52 -0600)
Fixes a bug where psp->WaitX was uninitialized.  Reported by Chris Clayton.

src/glx/x11/dri_glx.c
src/glx/x11/drisw_glx.c

index 87d62ad..3ce410d 100644 (file)
@@ -614,7 +614,7 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
     char *driverName;
     int i;
 
-    psp = Xmalloc(sizeof *psp);
+    psp = Xcalloc(1, sizeof *psp);
     if (psp == NULL)
        return NULL;
 
index 35bbd91..5e3d763 100644 (file)
@@ -359,7 +359,7 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
    const char *driverName = "swrast";
    int i;
 
-   psp = Xmalloc(sizeof *psp);
+   psp = Xcalloc(1, sizeof *psp);
    if (psp == NULL)
       return NULL;