Re: [PATCH 24/24] revisions API: have release_revisions() release "topo_walk_info"

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

 



On 3/9/2022 8:16 AM, Ævar Arnfjörð Bjarmason wrote:
> Refactor the existing reset_topo_walk() into a thin wrapper for a
> release_revisions_topo_walk_info() + resetting the member to "NULL",
> and call release_revisions_topo_walk_info() from release_revisions().
> 
> This fixes memory leaks that have been with us ever since
> "topo_walk_info" was added to revision.[ch] in
> f0d9cc4196a (revision.c: begin refactoring --topo-order logic,
> 2018-11-01).

Excellent.

> +static void reset_topo_walk(struct rev_info *revs)
> +{
> +	struct topo_walk_info *info = revs->topo_walk_info;

Why add this variable?
  
> -	FREE_AND_NULL(revs->topo_walk_info);
> +	release_revisions_topo_walk_info(info);

For only this use?

	release_revisions_topo_walk_info(revs->topo_walk_info);

seems to work just fine. Is the line too long?

Thanks,
-Stolee



[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