Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-21 23:35:39 +0400
committerJunio C Hamano <gitster@pobox.com>2014-07-21 23:35:39 +0400
commit9ab08822556c49a7856dadd0e9a42f9ec2aaf850 (patch)
treef52f20367d13f2078fe6199e230322c899b9308d /builtin/index-pack.c
parent0eff86e4f440fedf26f02f4c3b1a3ead8bfbe6f8 (diff)
parent5c0b13f85ab3a5326508b854768eb70c8829cda4 (diff)
Merge branch 'maint'
* maint: use xmemdupz() to allocate copies of strings given by start and length use xcalloc() to allocate zero-initialized memory
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index fc40411892..5568a5bc3b 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -362,8 +362,7 @@ static void set_thread_data(struct thread_local *data)
static struct base_data *alloc_base_data(void)
{
- struct base_data *base = xmalloc(sizeof(struct base_data));
- memset(base, 0, sizeof(*base));
+ struct base_data *base = xcalloc(1, sizeof(struct base_data));
base->ref_last = -1;
base->ofs_last = -1;
return base;