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/egl/drivers/dri2/egl_dri2.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/egl/drivers/dri2/egl_dri2.c')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index f99bcad3081..4b58c35b46b 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1477,12 +1477,10 @@ _eglBuiltInDriverDRI2(const char *args) (void) args; - dri2_drv = malloc(sizeof *dri2_drv); + dri2_drv = calloc(1, sizeof *dri2_drv); if (!dri2_drv) return NULL; - memset(dri2_drv, 0, sizeof *dri2_drv); - if (!dri2_load(&dri2_drv->base)) { free(dri2_drv); return NULL; |