summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorDmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>2014-03-03 22:31:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-03-03 22:44:11 (GMT)
commit25e194070975d4410775e6db0165f4b3b9132bd3 (patch)
treeda153239b0e8b3ef200a732a151ba5ceaba59198 /builtin/pack-objects.c
parent5f95c9f850b19b368c43ae399cc831b17a26a5ac (diff)
downloadgit-25e194070975d4410775e6db0165f4b3b9132bd3.zip
git-25e194070975d4410775e6db0165f4b3b9132bd3.tar.gz
git-25e194070975d4410775e6db0165f4b3b9132bd3.tar.bz2
builtin/pack-objects.c: use ALLOC_GROW() in check_pbase_path()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 541667f..b53bb5b 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1156,12 +1156,9 @@ static int check_pbase_path(unsigned hash)
if (0 <= pos)
return 1;
pos = -pos - 1;
- if (done_pbase_paths_alloc <= done_pbase_paths_num) {
- done_pbase_paths_alloc = alloc_nr(done_pbase_paths_alloc);
- done_pbase_paths = xrealloc(done_pbase_paths,
- done_pbase_paths_alloc *
- sizeof(unsigned));
- }
+ ALLOC_GROW(done_pbase_paths,
+ done_pbase_paths_num + 1,
+ done_pbase_paths_alloc);
done_pbase_paths_num++;
if (pos < done_pbase_paths_num)
memmove(done_pbase_paths + pos + 1,