Re: [PATCH 10/15] builtin/pack-refs: release allocated memory

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

 



On Wed, Mar 20, 2024 at 04:23:54PM -0700, Karthik Nayak wrote:
> Patrick Steinhardt <ps@xxxxxx> writes:
> 
> > Some of the command line options in `cmd_pack_refs()` require us to
> > allocate memory. This memory is never released and thus leaking, but we
> > paper over this leak by declaring the respective variables as `static`
> > function-level variables, which is somewhat awkward.
> >
> > Refactor the code to release the allocated memory and drop the `static`
> > declaration. While at it, remove the useless `flags` variable.
> >
> 
> Tangent: I was looking at `files_pack_refs` and it seems like there are
> a bunch of `die(...)` calls there. I wonder if it would be nicer to use
> `error()` instead so we could do a better job at cleanup.

I agree that this would be a nice refactoring.

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