Replace another malloc/memset-0 combination with calloc

Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Matt Turner 2012-09-04 23:12:46 -07:00
parent 52789496a7
commit da3282b6e2

View file

@ -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);
/*