Re: [PATCH 20/29] sequencer: fix leaking string buffer in `commit_staged_changes()`
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 3, 2024, 13:14 UTC
- Message-ID
- <758f2321-dc63-4209-8b54-99b74b6bb897@gmail.com>
- In-Reply-To
- <48bcd0ac80ee0b60eeda2bcedf55003a5049f289.1717402439.git.ps@pks.im>
Hi Patrick
On 03/06/2024 10:48, Patrick Steinhardt wrote:
Show 10 quoted lines
> @@ -5259,12 +5277,13 @@ static int commit_staged_changes(struct repository *r,
> }
> unuse_commit_buffer:
> repo_unuse_commit_buffer(r, commit, p);
> - if (res)
> - return res;
> + if (res) {
> + ret = res;
> + goto out;
> + }Having 'ret' and 'res' in this block is a bit confusing - we could delete the declaration for 'res' and either replace its use with 'ret', or rename 'ret' to 'res' in this patch.
Apart from that this all looks sensible to me, it is nice to see the number of leaks going down.
Thanks
Phillip