mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 15:33:51 +00:00
submodule: don't double free during load failure
When we fail to load submodules, don't free the list; it is later freed unconditionally.
This commit is contained in:
parent
1196807380
commit
0fbff82b57
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user