Skip to content

Commit

Permalink
dir.c: use ALLOC_GROW() in create_simplify()
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Dmitry S. Dolzhenko authored and Junio C Hamano committed Mar 3, 2014
1 parent 6647cc2 commit 9af49f8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9af49f8

Please sign in to comment.