Thread (2 messages) flat view 2 messages, 2 authors, 2021-10-13

Re: [PATCH v2 5/7] ls-files: fix a trivial dir_clear() leak

From: Junio C Hamano <hidden>
Date: 2021-10-07 22:47:03

Possibly related (same subject, not in this thread)

Ævar Arnfjörð Bjarmason  [off-list ref] writes:
This does add a bit of complexity, but I think it's worth it to just
fix these leaks when it's easy in built-ins. It allows them to serve
as canaries for underlying APIs that shouldn't be leaking, it
encourages us to make those freeing APIs nicer for all their users,
and it prevents other leaking regressions by being able to mark the
entire test as TEST_PASSES_SANITIZE_LEAK=true.
This does more than necessary, though.  Introducing "ret", replacing
an early return with an assignment to it, and returning "ret"
instead of hardcoded 0, would have been the "fix a trivial leak",
and the "ah, report_path_error() always returns true" does not
belong here.

These things look small, but small things add up.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help