]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit-reach: fix memory leak in get_reachable_subset()
authorMike Hommey <mh@glandium.org>
Sat, 3 Jun 2023 00:28:19 +0000 (09:28 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 4 Jun 2023 04:43:48 +0000 (13:43 +0900)
This is a leak that has existed since the method was first created
in fcb2c0769db (commit-reach: implement get_reachable_subset,
2018-11-02).

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-reach.c

index 2e33c599a82c81127b9a24547d0834e6c7a55bcf..58267d5420ec194fcda69a17cc4d9bd4cbd067b4 100644 (file)
@@ -936,6 +936,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);