diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-08-01 12:41:01 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-08-01 17:47:37 +0200 |
commit | 57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9 (patch) | |
tree | 275d3fe9bf76a8db25976b5eda5271a99570fb52 /convert.c | |
parent | t/test-repository: fix leaking repository (diff) | |
download | git-57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9.tar.xz git-57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9.zip |
object-name: fix leaking commit list items
When calling `get_oid_oneline()`, we pass in a `struct commit_list` that
gets modified by the function. This creates a weird situation where the
commit list may sometimes be empty after returning, but sometimes it
will continue to carry additional commits. In those cases the remainder
of the list leaks.
Ultimately, the design where we only pass partial ownership to
`get_oid_oneline()` feels shoddy. Refactor the code such that we only
pass a constant pointer to the list, creating a local copy as needed.
Callers are thus always responsible for freeing the commit list, which
then allows us to plug a bunch of memory leaks.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'convert.c')
0 files changed, 0 insertions, 0 deletions