dir.c: use ALLOC_GROW() in create_simplify()

Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Dmitry S. Dolzhenko 2014-03-04 02:31:58 +04:00 committed by Junio C Hamano
parent 6647cc2626
commit 9af49f822b

5
dir.c
View File

@ -1329,10 +1329,7 @@ static struct path_simplify *create_simplify(const char **pathspec)
for (nr = 0 ; ; nr++) {
const char *match;
if (nr >= alloc) {
alloc = alloc_nr(alloc);
simplify = xrealloc(simplify, alloc * sizeof(*simplify));
}
ALLOC_GROW(simplify, nr + 1, alloc);
match = *pathspec++;
if (!match)
break;