diff options
| author | Carlos MartÃn Nieto <carlosmn@github.com> | 2017-01-24 21:26:41 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-24 21:26:41 +0000 |
| commit | 8df1cfc9d710db48469e2ea34152cfe03d4bf515 (patch) | |
| tree | e94741dc2dac627fb14071bd7759364d2640f56b /src/submodule.c | |
| parent | 9b51cc82ff7dd6b771a9e4ba5c3aa601b631a98f (diff) | |
| parent | 1f813cf2b8c9b1976cec15014dec8edd854f8e88 (diff) | |
| download | libgit2-8df1cfc9d710db48469e2ea34152cfe03d4bf515.tar.gz | |
Merge pull request #4086 from libgit2/ethomson/fixes
WIP: some coverity & compiler warning fixes
Diffstat (limited to 'src/submodule.c')
| -rw-r--r-- | src/submodule.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/submodule.c b/src/submodule.c index e1f59b88e..fc3dcb406 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -188,8 +188,7 @@ static int load_submodule_names(git_strmap *out, git_config *cfg) git_buf_put(&buf, fdot + 1, ldot - fdot - 1); git_strmap_insert(out, entry->value, git_buf_detach(&buf), rval); if (rval < 0) { - giterr_set(GITERR_NOMEMORY, "Error inserting submodule into hash table"); - free_submodule_names(out); + giterr_set(GITERR_NOMEMORY, "error inserting submodule into hash table"); return -1; } } @@ -513,12 +512,12 @@ int git_submodule__map(git_repository *repo, git_strmap *map) goto cleanup; } /* add back submodule information from index */ - if (idx) { + if (mods && idx) { if ((error = submodules_from_index(map, idx, mods)) < 0) goto cleanup; } /* add submodule information from HEAD */ - if (head) { + if (mods && head) { if ((error = submodules_from_head(map, head, mods)) < 0) goto cleanup; } |
