From: Rubén Justo Date: Mon, 22 Apr 2024 23:04:00 GMT Subject: Re: [PATCH 4/4] add: plug a leak on interactive_add Message-ID: In-Reply-To: <55f1da17-6f07-4b25-9cf2-0de69bfb5005@gmail.com> On 4/22/24 5:43 PM, Phillip Wood wrote: >> Plug a leak we have since 5a76aff1a6 (add: convert to use >> parse_pathspec, 2013-07-14). >> >> This leak can be triggered with: >>      $ git add -p anything >> >> Fixing this leak allows us to mark as leak-free the following tests: >> >>      + t3701-add-interactive.sh >>      + t7514-commit-patch.sh >> >> Mark them with "TEST_PASSES_SANITIZE_LEAK=true" to notice and fix >> promply any new leak that may be introduced and triggered by them in the >> future. > > This makes me wonder if we're freeing the pathspec properly when using '--patch' in checkout, reset, restore and stash. I haven't checked it thoroughly, but I think we're fine in those cases.