Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'submodule-config.c')
-rw-r--r--submodule-config.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/submodule-config.c b/submodule-config.c
index ce3beaf5d4..51ecbe901e 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -756,7 +756,10 @@ static void traverse_tree_submodules(struct repository *r,
if (S_ISGITLINK(name_entry->mode) &&
is_tree_submodule_active(r, root_tree, tree_path)) {
- st_entry = xmalloc(sizeof(*st_entry));
+ ALLOC_GROW(out->entries, out->entry_nr + 1,
+ out->entry_alloc);
+ st_entry = &out->entries[out->entry_nr++];
+
st_entry->name_entry = xmalloc(sizeof(*st_entry->name_entry));
*st_entry->name_entry = *name_entry;
st_entry->submodule =
@@ -766,9 +769,6 @@ static void traverse_tree_submodules(struct repository *r,
root_tree))
FREE_AND_NULL(st_entry->repo);
- ALLOC_GROW(out->entries, out->entry_nr + 1,
- out->entry_alloc);
- out->entries[out->entry_nr++] = *st_entry;
} else if (S_ISDIR(name_entry->mode))
traverse_tree_submodules(r, root_tree, tree_path,
&name_entry->oid, out);