diff options
author | Edward Thomson <ethomson@github.com> | 2017-01-22 00:30:02 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@github.com> | 2017-01-23 22:24:40 +0000 |
commit | 0fbff82b579ae4bb764a293e9f4ef543c549ba2b (patch) | |
tree | b095fd39c545d39d965bde4270cc1646ab62c3a3 | |
parent | 1196807380b73f202bc1fea3045e13b719a465e9 (diff) | |
download | libgit2-0fbff82b579ae4bb764a293e9f4ef543c549ba2b.tar.gz |
submodule: don't double free during load failure
When we fail to load submodules, don't free the list; it is later freed
unconditionally.
-rw-r--r-- | src/submodule.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/submodule.c b/src/submodule.c index e1f59b88e..9e007df2b 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; } } |