From 6bda027e01c15df24d36de5bf3838ea8ed7e9e56 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 4 Sep 2012 23:09:22 -0700 Subject: 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 --- src/glx/applegl_glx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/glx/applegl_glx.c') diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index c3597cee765..a67416ec3f4 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -173,11 +173,10 @@ applegl_create_screen(int screen, struct glx_display * priv) { struct glx_screen *psc; - psc = malloc(sizeof *psc); + psc = calloc(1, sizeof *psc); if (psc == NULL) return NULL; - memset(psc, 0, sizeof *psc); glx_screen_init(psc, screen, priv); psc->vtable = &applegl_screen_vtable; -- cgit v1.2.3