glx: zero out drawable structs after allocation
authorKristian Høgsberg <krh@bitplanet.net>
Sat, 24 Jul 2010 01:45:05 +0000 (21:45 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Sat, 24 Jul 2010 02:05:53 +0000 (22:05 -0400)
src/glx/dri2_glx.c
src/glx/dri_glx.c
src/glx/drisw_glx.c

index 58f09ed86af66f9e63fffd5f8b39c1b1c40144f8..4a08f84de3cf193f55a983442644f094ee538f71 100644 (file)
@@ -224,6 +224,7 @@ dri2CreateDrawable(__GLXscreenConfigs *base, XID xDrawable,
    if (!pdraw)
       return NULL;
 
+   memset(pdraw, 0, sizeof *pdraw);
    pdraw->base.destroyDrawable = dri2DestroyDrawable;
    pdraw->base.xDrawable = xDrawable;
    pdraw->base.drawable = drawable;
index 95cded792d916417cef047e11010e22c35360583..d0f680de636a1a3e587c6b63dbc976c544f0097d 100644 (file)
@@ -633,6 +633,7 @@ driCreateDrawable(__GLXscreenConfigs *base,
    if (!pdp)
       return NULL;
 
+   memset(pdp, 0, sizeof *pdp);
    pdp->base.drawable = drawable;
    pdp->base.psc = &psc->base;
 
index 4265f564120a87564ec66f76d753fc35d0145517..852e56e484ea6d71d6963e8d41150244671f8f09 100644 (file)
@@ -362,6 +362,7 @@ driCreateDrawable(__GLXscreenConfigs *base, XID xDrawable,
    if (!pdp)
       return NULL;
 
+   memset(pdp, 0, sizeof *pdp);
    pdp->base.xDrawable = xDrawable;
    pdp->base.drawable = drawable;
    pdp->base.psc = &psc->base;