mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 05:38:16 +02:00
glx: convert a malloc+memset to calloc
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
parent
cabd09c9e7
commit
97d58eabcc
1 changed files with 1 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue