提交 25e19407 编写于 作者: D Dmitry S. Dolzhenko 提交者: Junio C Hamano

builtin/pack-objects.c: use ALLOC_GROW() in check_pbase_path()

Signed-off-by: NDmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 5f95c9f8
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册