Use calloc instead of malloc + memset(.., 0, ..)

MFC after:	5 days
This commit is contained in:
Enji Cooper 2017-01-09 06:03:49 +00:00
parent c5f8d75113
commit 8406423362

View File

@ -399,12 +399,11 @@ static void
save_typdef(char *name)
{
struct tdef *t;
t = malloc(sizeof(struct tdef));
t = calloc(1, sizeof(struct tdef));
if (t == NULL)
err(1, NULL);
memset(t, 0 , sizeof(struct tdef));
t->name = name;
SLIST_INSERT_HEAD(&tdefs, t, link);
}