summaryrefslogtreecommitdiff
path: root/t/unit-tests
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-14 08:52:31 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-14 10:07:59 -0700
commita0b82622cbb31de66d7f5f0b1e39f349edaeb009 (patch)
tree2a4b8fe8de45e8cb967b753106a2e3be07bccad6 /t/unit-tests
parent8ed4e96b5bcbd98e8d9f4593d53d8729280f47b9 (diff)
builtin/fast-export: plug leaking tag names
When resolving revisions in `get_tags_and_duplicates()`, we only partially manage the lifetime of `full_name`. In fact, managing its lifetime properly is almost impossible because we put direct pointers to that variable into multiple lists without duplicating the string. The consequence is that these strings will ultimately leak. Refactor the code to make the lists we put those names into duplicate the memory. This allows us to properly free the string as required and thus plugs the memory leak. While this requires us to allocate more data overall, it shouldn't be all that bad given that the number of allocations corresponds with the number of command line parameters, which typically aren't all that many. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests')
0 files changed, 0 insertions, 0 deletions