diff mbox series

Fix memory leak in get_reachable_subset

Message ID 20230421234409.1925489-1-mh@glandium.org (mailing list archive)
State Accepted
Commit 68b51172e310beeb4ace56645a9f2b823e6fe12d
Headers show
Series Fix memory leak in get_reachable_subset | expand

Commit Message

Mike Hommey April 21, 2023, 11:44 p.m. UTC
---
 commit-reach.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Derrick Stolee April 24, 2023, 3:21 p.m. UTC | #1
On 4/21/2023 7:44 PM, Mike Hommey wrote:
> @@ -944,6 +944,8 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
>  		}
>  	}
>  
> +	clear_prio_queue(&queue);
> +

Thanks. This is a leak that has existed since the method was first
created in fcb2c0769db (commit-reach: implement get_reachable_subset,
2018-11-02). I appreciate the attention to detail.

-Stolee
Junio C Hamano April 24, 2023, 4:09 p.m. UTC | #2
Mike Hommey <mh@glandium.org> writes:

> ---
>  commit-reach.c | 2 ++
>  1 file changed, 2 insertions(+)

Missing sign-off?

[jc: adding the author of fcb2c076 (commit-reach: implement
get_reachable_subset, 2018-11-02) to the CC list]

> diff --git a/commit-reach.c b/commit-reach.c
> index 70bde8af05..f15d84566b 100644
> --- a/commit-reach.c
> +++ b/commit-reach.c
> @@ -944,6 +944,8 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
>  		}
>  	}
>  
> +	clear_prio_queue(&queue);
> +
>  	clear_commit_marks_many(nr_to, to, PARENT1);
>  	clear_commit_marks_many(nr_from, from, PARENT2);

Looking good.
Mike Hommey April 24, 2023, 8:41 p.m. UTC | #3
On Mon, Apr 24, 2023 at 09:09:33AM -0700, Junio C Hamano wrote:
> Mike Hommey <mh@glandium.org> writes:
> 
> > ---
> >  commit-reach.c | 2 ++
> >  1 file changed, 2 insertions(+)
> 
> Missing sign-off?

Gah. Sorry, I forgot it in this and another patch I sent a few days
ago ([PATCH] Handle compiler versions containing a dash)

Do you want full resends or is it okay if I just add

  Signed-off-by: Mike Hommey <mh@glandium.org>

here?

Mike
diff mbox series

Patch

diff --git a/commit-reach.c b/commit-reach.c
index 70bde8af05..f15d84566b 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -944,6 +944,8 @@  struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
 		}
 	}
 
+	clear_prio_queue(&queue);
+
 	clear_commit_marks_many(nr_to, to, PARENT1);
 	clear_commit_marks_many(nr_from, from, PARENT2);