summaryrefslogtreecommitdiffstats
path: root/src/glx/dri_glx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/dri_glx.c')
-rw-r--r--src/glx/dri_glx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index a158de023ba..3a727e52904 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -593,11 +593,10 @@ dri_create_context(struct glx_screen *base,
shared = pcp_shared->driContext;
}
- pcp = malloc(sizeof *pcp);
+ pcp = calloc(1, sizeof *pcp);
if (pcp == NULL)
return NULL;
- memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
free(pcp);
return NULL;
@@ -651,11 +650,10 @@ driCreateDrawable(struct glx_screen *base,
if (xDrawable != drawable)
return NULL;
- pdp = malloc(sizeof *pdp);
+ pdp = calloc(1, sizeof *pdp);
if (!pdp)
return NULL;
- memset(pdp, 0, sizeof *pdp);
pdp->base.drawable = drawable;
pdp->base.psc = &psc->base;