diff --git a/commit.c b/commit.c
index eb42d517a4959d83593b7ba9e8fcbc650fea7a5e..d4976fb89f30eacaa1cfe015c6f7a035a1225f55 100644 (file)
--- a/commit.c
+++ b/commit.c
{
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;