Skip to content

Commit 6c9a258

Browse files
starseekercshorler
authored andcommitted
Use calloc to initialize the names array.
1 parent 0fd354c commit 6c9a258

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/exppp/pretty_type.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void TYPE_body_out( Type t, int level ) {
151151
while( 0 != ( expr = ( Expression )DICTdo( &de ) ) ) {
152152
count++;
153153
}
154-
names = ( char ** )sc_malloc( count * sizeof( char * ) );
154+
names = ( char ** )sc_calloc( count, sizeof( char * ) );
155155
DICTdo_type_init( t->symbol_table, &de, OBJ_EXPRESSION );
156156
while( 0 != ( expr = ( Expression )DICTdo( &de ) ) ) {
157157
names[expr->u.integer - 1] = expr->symbol.name;

0 commit comments

Comments
 (0)