From: Jeff King Date: Fri, 29 Jul 2022 19:00:40 GMT Subject: Re: [PATCH v2 6/6] revisions API: don't leak memory on argv elements that need free()-ing Message-ID: In-Reply-To: On Fri, Jul 29, 2022 at 10:31:08AM +0200, Ævar Arnfjörð Bjarmason wrote: > Add a "free_removed_argv_elements" member to "struct > setup_revision_opt", and use it to fix several memory leaks, e.g. the > one with a "XXX" comment added in 8a534b61241 (bisect: use argv_array > API, 2011-09-13). I think the mention of this "XXX" comment is a little misleading. That comment is not talking about leaking the "--" entry. It is talking about leaking the _entire_ strvec, because of memory-lifetime issues. And we fixed those already in 5. It's a small point, and the code here is fine. But if you take my suggested replacement for 5, then it becomes even more nonsensical. ;) -Peff