diff options
author | Edward Thomson <ethomson@github.com> | 2017-01-25 13:01:12 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@github.com> | 2017-01-25 13:01:12 +0000 |
commit | c680225ab779aa132a43f607e7d8a9a16acda766 (patch) | |
tree | db6f52e7206fe256d13fd5f289a7644ddd806dad | |
parent | 8df1cfc9d710db48469e2ea34152cfe03d4bf515 (diff) | |
download | libgit2-ethomson/fixes.tar.gz |
submodule: set a default to the iteratorethomson/fixes
The iterator is always freed, but not always initialized first.
-rw-r--r-- | src/submodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/submodule.c b/src/submodule.c index fc3dcb406..0db58f44b 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -401,9 +401,10 @@ done: static int submodules_from_head(git_strmap *map, git_tree *head, git_config *cfg) { int error; - git_iterator *i; + git_iterator *i = NULL; const git_index_entry *entry; git_strmap *names = 0; + git_strmap_alloc(&names); if ((error = load_submodule_names(names, cfg))) goto done; |