Re: [PATCH v2 01/27] t/helper/test-fast-rebase.c: don't leak "struct strbuf"
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Mar 24, 2022, 16:57 UTC
- Message-ID
- <220324.86pmmbmglo.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <xmqqr16sm1im.fsf@gitster.g>
On Wed, Mar 23 2022, Junio C Hamano wrote:
Show 19 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: > >> Fix a memory leak that's been with us since f9500261e0a (fast-rebase: >> write conflict state to working tree, index, and HEAD, 2021-05-20) >> changed this code to move these strbuf_release() into an if/else >> block. >> >> We'll also add to "reflog_msg" in the "else" arm of the "if" block >> being modified here, and we'll append to "branch_msg" in both >> cases. But after f9500261e0a only the "if" block would free these two >> "struct strbuf". >> >> This change is needed so that a subsequent addition of a "goto >> cleanup" pattern when adding release_revisions() doesn't solve this >> unrelated bug while it's at it. > > With or without the goto-cleanup change, this fix alone is the right > fix for these leaks. I would not have written the last paragraph if > I were working on this topic ;-)
To this and your 02/27 comment: Sure, I can remove that.
In general I think it's bad form for individual commits to discuss the series they're in, they should be stand-alone.
But I'm pretty sure if I left this out I'd have gotten questions about why these seemingly unrelated leak fixes are here as art of series implementing release_revisions(), from either you or someone else :)