diff options
author | Linquize <linquize@yahoo.com.hk> | 2013-05-16 21:08:55 +0800 |
---|---|---|
committer | Linquize <linquize@yahoo.com.hk> | 2013-05-16 21:11:38 +0800 |
commit | 7026ad893b5ba54b11c7397f10d6fdf64683062f (patch) | |
tree | 722b57f66bf479ff4546bcc56cd495bc75143730 /src/indexer.c | |
parent | 12f831fa1500bdcd1b9a2ef20c4897904983af8e (diff) | |
download | libgit2-7026ad893b5ba54b11c7397f10d6fdf64683062f.tar.gz |
calloc() to initialize memory
Diffstat (limited to 'src/indexer.c')
-rw-r--r-- | src/indexer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/indexer.c b/src/indexer.c index 91b7ba5d9..1b5339f23 100644 --- a/src/indexer.c +++ b/src/indexer.c @@ -259,7 +259,7 @@ static int store_object(git_indexer_stream *idx) entry = git__calloc(1, sizeof(*entry)); GITERR_CHECK_ALLOC(entry); - pentry = git__malloc(sizeof(struct git_pack_entry)); + pentry = git__calloc(1, sizeof(struct git_pack_entry)); GITERR_CHECK_ALLOC(pentry); git_hash_final(&oid, ctx); @@ -328,7 +328,7 @@ static int hash_and_save(git_indexer_stream *idx, git_rawobj *obj, git_off_t ent return -1; } - pentry = git__malloc(sizeof(struct git_pack_entry)); + pentry = git__calloc(1, sizeof(struct git_pack_entry)); GITERR_CHECK_ALLOC(pentry); git_oid_cpy(&pentry->sha1, &oid); |