Re: [PATCH 20/29] sequencer: fix leaking string buffer in `commit_staged_changes()`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 03, 2024 at 02:14:20PM +0100, Phillip Wood wrote:
> Hi Patrick
> 
> On 03/06/2024 10:48, Patrick Steinhardt wrote:
> > @@ -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.

Yeah, let's just drop the local `res` variable here and use `ret`
instead.

> Apart from that this all looks sensible to me, it is nice to see the number
> of leaks going down.
> 
> Thanks

Thanks!

Patrick

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux