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>
This commit is contained in:
parent
9019e5e195
commit
f0a8bcd84e
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue