summaryrefslogtreecommitdiffstats
path: root/worktree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-10 22:24:23 +0100
committerJunio C Hamano <gitster@pobox.com>2017-03-10 22:24:23 +0100
commitfc32293502e86be2cabbe5e8e5863a2b657207b8 (patch)
tree87798ac7776dc9473d09f94ec45b96398cbc16b9 /worktree.c
parentMerge branch 'rs/sha1-file-plug-fallback-base-leak' (diff)
parentstrbuf: add strbuf_add_real_path() (diff)
downloadgit-fc32293502e86be2cabbe5e8e5863a2b657207b8.tar.xz
git-fc32293502e86be2cabbe5e8e5863a2b657207b8.zip
Merge branch 'rs/strbuf-add-real-path'
An helper function to make it easier to append the result from real_path() to a strbuf has been added. * rs/strbuf-add-real-path: strbuf: add strbuf_add_real_path() cocci: use ALLOC_ARRAY
Diffstat (limited to 'worktree.c')
-rw-r--r--worktree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/worktree.c b/worktree.c
index d633761575..d7b911aac7 100644
--- a/worktree.c
+++ b/worktree.c
@@ -175,7 +175,7 @@ struct worktree **get_worktrees(unsigned flags)
struct dirent *d;
int counter = 0, alloc = 2;
- list = xmalloc(alloc * sizeof(struct worktree *));
+ ALLOC_ARRAY(list, alloc);
list[counter++] = get_main_worktree();