diff options
author | Matt Turner <[email protected]> | 2012-09-04 23:09:22 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2012-09-05 22:28:50 -0700 |
commit | 6bda027e01c15df24d36de5bf3838ea8ed7e9e56 (patch) | |
tree | bb41d06abd676913add0761732908c064b68663a /src/glx/indirect_glx.c | |
parent | 5067506ea6ada5eeae33b1acf1c916e00121c12a (diff) |
Use calloc instead of malloc/memset-0
This patch has been generated by the following Coccinelle semantic
patch:
@@
expression E;
identifier I;
@@
- I = malloc(E);
+ I = calloc(1, E);
...
- memset(I, 0, sizeof *I);
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/glx/indirect_glx.c')
-rw-r--r-- | src/glx/indirect_glx.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c index 5eef59c1d5a..f3cc1e7d049 100644 --- a/src/glx/indirect_glx.c +++ b/src/glx/indirect_glx.c @@ -352,12 +352,11 @@ indirect_create_context(struct glx_screen *psc, } /* Allocate our context record */ - gc = malloc(sizeof *gc); + gc = calloc(1, sizeof *gc); if (!gc) { /* Out of memory */ return NULL; } - memset(gc, 0, sizeof *gc); glx_context_init(gc, psc, mode); gc->isDirect = GL_FALSE; @@ -464,11 +463,10 @@ indirect_create_screen(int screen, struct glx_display * priv) { struct glx_screen *psc; - psc = malloc(sizeof *psc); + psc = calloc(1, sizeof *psc); if (psc == NULL) return NULL; - memset(psc, 0, sizeof *psc); glx_screen_init(psc, screen, priv); psc->vtable = &indirect_screen_vtable; |