Use calloc instead of malloc + memset(.., 0, ..)
MFC after: 5 days
This commit is contained in:
parent
c5f8d75113
commit
8406423362
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user