mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
Replace another malloc/memset-0 combination with calloc
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
52789496a7
commit
da3282b6e2
1 changed files with 1 additions and 2 deletions
|
|
@ -361,14 +361,13 @@ indirect_create_context(struct glx_screen *psc,
|
|||
glx_context_init(gc, psc, mode);
|
||||
gc->isDirect = GL_FALSE;
|
||||
gc->vtable = &indirect_context_vtable;
|
||||
state = malloc(sizeof(struct __GLXattributeRec));
|
||||
state = calloc(1, sizeof(struct __GLXattributeRec));
|
||||
if (state == NULL) {
|
||||
/* Out of memory */
|
||||
free(gc);
|
||||
return NULL;
|
||||
}
|
||||
gc->client_state_private = state;
|
||||
memset(gc->client_state_private, 0, sizeof(struct __GLXattributeRec));
|
||||
state->NoDrawArraysProtocol = (getenv("LIBGL_NO_DRAWARRAYS") != NULL);
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue