summaryrefslogtreecommitdiff
path: root/tests/diff/diffiter.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-05-30 08:35:06 +0200
committerPatrick Steinhardt <ps@pks.im>2018-05-30 10:35:12 +0200
commitb2a389c87019c729ffaf179a338236dd129b473c (patch)
treeaaf1ed7a77ba0caed87546babec0759fc1c93136 /tests/diff/diffiter.c
parent36ae5c9330cf2ba22c3c6075752605a712755b60 (diff)
downloadlibgit2-b2a389c87019c729ffaf179a338236dd129b473c.tar.gz
submodule: detect duplicated submodule paths
When loading submodule names, we build a map of submodule paths and their respective names. While looping over the configuration keys, we do not check though whether a submodule path was seen already. This leads to a memory leak in case we have multiple submodules with the same path, as we just overwrite the old value in the map in that case. Fix the error by verifying that the path to be added is not yet part of the string map. Git does not allow to have multiple submodules for a path anyway, so we now do the same and detect this duplication, reporting it to the user.
Diffstat (limited to 'tests/diff/diffiter.c')
0 files changed, 0 insertions, 0 deletions