Use calloc(), instead of malloc()ing and memset()ing.

2009-01-29  Behdad Esfahbod  <behdad@gnome.org>

        * pango/opentype/harfbuzz-impl.c (_hb_alloc): Use calloc(),
        instead of malloc()ing and memset()ing.
This commit is contained in:
Behdad Esfahbod 2009-01-29 09:19:56 +00:00 committed by Behdad Esfahbod
parent 94c21d26ba
commit 9372edd6f0
1 changed files with 1 additions and 3 deletions

View File

@ -38,11 +38,9 @@ _hb_alloc( HB_UInt size,
if ( size > 0 )
{
block = malloc( size );
block = calloc( 1, size );
if ( !block )
error = ERR(HB_Err_Out_Of_Memory);
else
memset( (char*)block, 0, (size_t)size );
}
*perror = error;