Commit 36a5b557 by Etienne Samson

submodule: don't leak memory when failing to insert the names

Reported by Coverity, CID 1393237
parent 17bd3b96
......@@ -260,7 +260,8 @@ static int load_submodule_names(git_strmap **out, git_repository *repo, git_conf
git_strmap_insert(names, entry->value, git_buf_detach(&buf), &rval);
if (rval < 0) {
giterr_set(GITERR_NOMEMORY, "error inserting submodule into hash table");
return -1;
error = -1;
goto out;
}
}
if (error == GIT_ITEROVER)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment