From: Jeff King Date: Mon, 12 Jun 2023 03:14:25 GMT Subject: Re: [PATCH 02/11] config: fix a leak in git_config_copy_or_rename_section_in_file Message-ID: <20230612031425.GB306352@coredump.intra.peff.net> In-Reply-To: <2ce6f067-9d02-2a10-5eb9-6820e66f0b84@gmail.com> On Sun, Jun 11, 2023 at 08:49:28PM +0200, Rubén Justo wrote: > In 52d59cc645 (branch: add a --copy (-c) option to go with --move (-m), > 2017-06-18) a new strbuf variable was introduced, but not released. > > Thus, when copying a branch that has any configuration, we have a > leak. > > $ git branch foo > $ git config branch.foo.some-key some_value > $ git branch -c foo bar Looks good. Thanks for digging up the commit which introduced the problem. I always find that gives me more confidence that the leak is just a simple "oops, we forgot to free", and there isn't something more subtle going on. -Peff