Mesa (mesa_7_4_branch): glx: replace Xmalloc() calls with Xcalloc()

Brian Paul brianp at kemper.freedesktop.org
Mon May 4 14:34:32 UTC 2009


Module: Mesa
Branch: mesa_7_4_branch
Commit: e9d5569bf3e5d7a78a790c144aed275f1a32f325
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e9d5569bf3e5d7a78a790c144aed275f1a32f325

Author: Brian Paul <brianp at vmware.com>
Date:   Mon May  4 08:34:20 2009 -0600

glx: replace Xmalloc() calls with Xcalloc()

Fixes a bug where psp->WaitX was uninitialized.  Reported by Chris Clayton.

(cherry picked from commit dd4c142e90a0cba5b445990bb522ce9199d7f565)

---

 src/glx/x11/dri_glx.c   |    2 +-
 src/glx/x11/drisw_glx.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c
index 3089aa1..372d9d9 100644
--- a/src/glx/x11/dri_glx.c
+++ b/src/glx/x11/dri_glx.c
@@ -600,7 +600,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;
 
diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c
index 35bbd91..5e3d763 100644
--- a/src/glx/x11/drisw_glx.c
+++ b/src/glx/x11/drisw_glx.c
@@ -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;
 




More information about the mesa-commit mailing list