From 97d58eabcc87d9b66b5837eeae0ce1174d29f448 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 14 Aug 2019 12:04:42 -0400 Subject: [PATCH] glx: convert a malloc+memset to calloc Reviewed-by: Eric Engestrom --- src/glx/glxconfig.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/glx/glxconfig.c b/src/glx/glxconfig.c index 555ccf8e62b..87a02fa9b6b 100644 --- a/src/glx/glxconfig.c +++ b/src/glx/glxconfig.c @@ -225,14 +225,13 @@ glx_config_create_list(unsigned count) next = &base; for (i = 0; i < count; i++) { - *next = malloc(size); + *next = calloc(1, size); if (*next == NULL) { glx_config_destroy_list(base); base = NULL; break; } - (void) memset(*next, 0, size); (*next)->visualID = GLX_DONT_CARE; (*next)->visualType = GLX_DONT_CARE; (*next)->visualRating = GLX_NONE; -- 2.30.2