Replace xmalloc+memset(0) with xcalloc.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
committed by
Junio C Hamano
parent
8e44025925
commit
90321c106c
3
commit.c
3
commit.c
@ -73,8 +73,7 @@ struct commit *lookup_commit(const unsigned char *sha1)
|
||||
{
|
||||
struct object *obj = lookup_object(sha1);
|
||||
if (!obj) {
|
||||
struct commit *ret = xmalloc(sizeof(struct commit));
|
||||
memset(ret, 0, sizeof(struct commit));
|
||||
struct commit *ret = xcalloc(1, sizeof(struct commit));
|
||||
created_object(sha1, &ret->object);
|
||||
ret->object.type = commit_type;
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user