summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-04-28 14:03:54 +0200
committerPatrick Steinhardt <ps@pks.im>2017-04-28 14:10:37 +0200
commit141096202b459a70ca127b1a56a6923a75a064e4 (patch)
tree269e20dc9ae82a80639c4e6cb004d427554091ee /include/git2
parent35079f507b5287a2a4726cae7753439f753453e2 (diff)
downloadlibgit2-141096202b459a70ca127b1a56a6923a75a064e4.tar.gz
odb: improve error handling in read_prefix_1
The read_prefix_1 function has several return statements springled throughout the code. As we have to free memory upon getting an error, the free code has to be repeated at every single retrun -- which it is not, so we have a memory leak here. Refactor the code to use the typical `goto out` pattern, which will free data when an error has occurred. While we're at it, we can also improve the error message thrown when multiple ambiguous prefixes are found. It will now include the colliding prefixes.
Diffstat (limited to 'include/git2')
0 files changed, 0 insertions, 0 deletions