[PATCH 11/17] Convert exa & fb to new *allocarray functions

Michel Dänzer michel at daenzer.net
Tue Mar 31 19:24:29 PDT 2015


On 01.04.2015 09:50, Alan Coopersmith wrote:
> @@ -667,7 +667,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
>          return;
>      }
>  
> -    prect = malloc(sizeof(xRectangle) * (npt - 1));
> +    prect = xallocarray(npt -1, sizeof(xRectangle));

'npt - 1'


> @@ -124,7 +124,7 @@ fbGlyphs(CARD8 op,
>      pixman_glyph_cache_freeze (glyphCache);
>  
>      if (n_glyphs > N_STACK_GLYPHS) {
> -	if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t))))
> +	if (!(pglyphs = xallocarray (n_glyphs, sizeof (pixman_glyph_t))))

You could remove the space between the function name and the opening
parenthesis while you're at it.


With the above fixed,

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list