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>
This commit is contained in:

committed by
Junio C Hamano

parent
5f95c9f850
commit
25e1940709
@ -1156,12 +1156,9 @@ static int check_pbase_path(unsigned hash)
|
|||||||
if (0 <= pos)
|
if (0 <= pos)
|
||||||
return 1;
|
return 1;
|
||||||
pos = -pos - 1;
|
pos = -pos - 1;
|
||||||
if (done_pbase_paths_alloc <= done_pbase_paths_num) {
|
ALLOC_GROW(done_pbase_paths,
|
||||||
done_pbase_paths_alloc = alloc_nr(done_pbase_paths_alloc);
|
done_pbase_paths_num + 1,
|
||||||
done_pbase_paths = xrealloc(done_pbase_paths,
|
done_pbase_paths_alloc);
|
||||||
done_pbase_paths_alloc *
|
|
||||||
sizeof(unsigned));
|
|
||||||
}
|
|
||||||
done_pbase_paths_num++;
|
done_pbase_paths_num++;
|
||||||
if (pos < done_pbase_paths_num)
|
if (pos < done_pbase_paths_num)
|
||||||
memmove(done_pbase_paths + pos + 1,
|
memmove(done_pbase_paths + pos + 1,
|
||||||
|
Reference in New Issue
Block a user