summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_wayland.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-09-21 21:15:26 -0700
committerMatt Turner <mattst88@gmail.com>2014-12-08 17:02:19 -0800
commitf0a8bcd84e50468a703a0ac366a4e067610df30c (patch)
treee234fa7ac51d504f5aee60576aff78f9adce6b9c /src/egl/drivers/dri2/platform_wayland.c
parent9019e5e19532fe214fc6e45b9ee1f60bbe332456 (diff)
downloadexternal_mesa3d-f0a8bcd84e50468a703a0ac366a4e067610df30c.zip
external_mesa3d-f0a8bcd84e50468a703a0ac366a4e067610df30c.tar.gz
external_mesa3d-f0a8bcd84e50468a703a0ac366a4e067610df30c.tar.bz2
Use calloc instead of malloc/memset-0
See commit 6bda027e for the Coccinelle script. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_wayland.c')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 59b2792..ba0eb10 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -130,13 +130,12 @@ dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
(void) drv;
- dri2_surf = malloc(sizeof *dri2_surf);
+ dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
return NULL;
}
- memset(dri2_surf, 0, sizeof *dri2_surf);
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf;