]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: fix leaking string buffer in `commit_staged_changes()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 11 Jun 2024 09:20:47 +0000 (11:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2024 20:15:07 +0000 (13:15 -0700)
commit1e5c1601f98afba0772c4548ec6befe6e97761e7
treeeeb9e7d283d03be3f898e66f521e165201382a77
parent63c9bd372e388f5fed77be56771d5ad972f37f8e
sequencer: fix leaking string buffer in `commit_staged_changes()`

We're leaking the `rev` string buffer in various call paths. Refactor
the function to have a common exit path so that we can release its
memory reliably.

This fixes a subset of tests failing with the memory sanitizer in t3404.
But as there are more failures, we cannot yet mark the whole test suite
as passing.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c