From: Dmitry S. Dolzhenko Date: Mon, 03 Mar 2014 22:31:58 GMT Subject: [PATCH v4 10/14] dir.c: use ALLOC_GROW() in create_simplify() Message-ID: <1393885922-21616-11-git-send-email-dmitrys.dolzhenko@yandex.ru> In-Reply-To: <1393885922-21616-1-git-send-email-dmitrys.dolzhenko@yandex.ru> Signed-off-by: Dmitry S. Dolzhenko --- dir.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dir.c b/dir.c index 98bb50f..4ae38e4 100644 --- a/dir.c +++ b/dir.c @@ -1341,10 +1341,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; -- 1.8.3.2