From: Adam Jackson Date: Wed, 14 Aug 2019 16:04:42 +0000 (-0400) Subject: glx: convert a malloc+memset to calloc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=97d58eabcc87d9b66b5837eeae0ce1174d29f448;p=mesa.git glx: convert a malloc+memset to calloc Reviewed-by: Eric Engestrom --- 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;