Skip to content

Commit 0fbff82

Browse files
author
Edward Thomson
committed
submodule: don't double free during load failure
When we fail to load submodules, don't free the list; it is later freed unconditionally.
1 parent 1196807 commit 0fbff82

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/submodule.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ static int load_submodule_names(git_strmap *out, git_config *cfg)
188188
git_buf_put(&buf, fdot + 1, ldot - fdot - 1);
189189
git_strmap_insert(out, entry->value, git_buf_detach(&buf), rval);
190190
if (rval < 0) {
191-
giterr_set(GITERR_NOMEMORY, "Error inserting submodule into hash table");
192-
free_submodule_names(out);
191+
giterr_set(GITERR_NOMEMORY, "error inserting submodule into hash table");
193192
return -1;
194193
}
195194
}

0 commit comments

Comments
 (0)