summaryrefslogtreecommitdiff
path: root/src/egl/drivers/dri2/platform_wayland.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-09-04 23:09:22 -0700
committerMatt Turner <mattst88@gmail.com>2012-09-05 22:28:50 -0700
commit6bda027e01c15df24d36de5bf3838ea8ed7e9e56 (patch)
treebb41d06abd676913add0761732908c064b68663a /src/egl/drivers/dri2/platform_wayland.c
parent5067506ea6ada5eeae33b1acf1c916e00121c12a (diff)
Use calloc instead of malloc/memset-0
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; identifier I; @@ - I = malloc(E); + I = calloc(1, E); ... - memset(I, 0, sizeof *I); Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_wayland.c')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index d291f0ffa40..d9b45f1cec2 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -813,12 +813,10 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
drv->API.CreateImageKHR = dri2_wayland_create_image_khr;
drv->API.Terminate = dri2_terminate;
- dri2_dpy = malloc(sizeof *dri2_dpy);
+ dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
- memset(dri2_dpy, 0, sizeof *dri2_dpy);
-
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->wl_dpy = wl_display_connect(NULL);