Mesa (master): glx: zero out drawable structs after allocation
Kristian Høgsberg
krh at kemper.freedesktop.org
Sat Jul 24 02:07:11 UTC 2010
Module: Mesa
Branch: master
Commit: 6393a33944ec9983426cecd5f6c9f05ac089e1ae
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6393a33944ec9983426cecd5f6c9f05ac089e1ae
Author: Kristian Høgsberg <krh at bitplanet.net>
Date: Fri Jul 23 21:45:05 2010 -0400
glx: zero out drawable structs after allocation
---
src/glx/dri2_glx.c | 1 +
src/glx/dri_glx.c | 1 +
src/glx/drisw_glx.c | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 58f09ed..4a08f84 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -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;
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index 95cded7..d0f680d 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -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;
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 4265f56..852e56e 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -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;
More information about the mesa-commit
mailing list