X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=commit.c;h=d4976fb89f30eacaa1cfe015c6f7a035a1225f55;hb=810e1523753553968aac827f57e0e24fc9af6546;hp=eb42d517a4959d83593b7ba9e8fcbc650fea7a5e;hpb=9086a18cb81f99fff943b36830396ac8c37c7e9f;p=git.git diff --git a/commit.c b/commit.c index eb42d517..d4976fb8 100644 --- a/commit.c +++ b/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;