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 58f09ed..4a08f84 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 95cded7..d0f680d 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 4265f56..852e56e 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;