initialize the new field properly

This commit is contained in:
Bill Currie 2003-08-01 02:43:51 +00:00
parent 0361cb261f
commit 24f4bcfebf

View file

@ -86,7 +86,7 @@ new_struct_field (struct_t *strct, type_t *type, const char *name,
if (!strct) if (!strct)
return 0; return 0;
field = malloc (sizeof (struct_field_t)); field = calloc (sizeof (struct_field_t), 1);
field->visibility = visibility; field->visibility = visibility;
if (name) if (name)
field->name = save_string (name); field->name = save_string (name);