Re: [PATCH v2] bundle-uri: plug leak in unbundle_from_file()

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

 



On Thu, Oct 10, 2024 at 11:12:49AM +0200, Toon Claes wrote:
> The function `unbundle_from_file()` has two memory leaks:
> 
>   - We do not release the `struct bundle_header header` when hitting
>     errors because we return early without any cleanup.
> 
>   - We do not release the `struct strbuf bundle_ref` at all.
> 
> Plug these leaks by creating a common exit path where both of these
> variables are released.
> 
> While at it, refactor the code such that the variable assignments do not
> happen inside the conditional statement itself according to our coding
> style.

Thanks, this version looks good to me. We now avoid any discussion
around the changed error code completely, and the commit message seems
reasonable to me.

Thanks!

Patrick




[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