{"thread":{"id":"59833","subject":"[PATCH] Fix memory leak in get_reachable_subset","startedAt":"2023-06-03T01:14:29Z","lastAt":"2023-06-05T15:51:15Z","messageCount":5,"participants":["Mike Hommey","Junio C Hamano","René Scharfe","Derrick Stolee"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"477998","messageId":"20230603002819.1122129-1-mh@glandium.org","threadId":"59833","inReplyTo":null,"subject":"[PATCH] Fix memory leak in get_reachable_subset","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2023-06-03T00:28:19Z","receivedAt":"2023-06-03T01:14:29Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"Signed-off-by: Mike Hommey <mh@glandium.org>\n---\n commit-reach.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/commit-reach.c b/commit-reach.c\nindex 70bde8af05..f15d84566b 100644\n--- a/commit-reach.c\n+++ b/commit-reach.c\n@@ -944,6 +944,8 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,\n \t\t}\n \t}\n \n+\tclear_prio_queue(&queue);\n+\n \tclear_commit_marks_many(nr_to, to, PARENT1);\n \tclear_commit_marks_many(nr_from, from, PARENT2);\n \n-- \n2.41.0.6.ge371d37104\n\n"},{"id":"478008","messageId":"xmqqedmt7167.fsf@gitster.g","threadId":"59833","inReplyTo":"20230603002819.1122129-1-mh@glandium.org","subject":"Re: [PATCH] Fix memory leak in get_reachable_subset","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-06-03T02:02:56Z","receivedAt":"2023-06-03T02:03:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Hommey <mh@glandium.org> writes:\n\n> Signed-off-by: Mike Hommey <mh@glandium.org>\n> ---\n\nAs most lines in the affected function seems to come from your\nfcb2c076 (commit-reach: implement get_reachable_subset, 2018-11-02),\nI'll redirect the review of this patch to you.\n\nThanks.\n\n>  commit-reach.c | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/commit-reach.c b/commit-reach.c\n> index 70bde8af05..f15d84566b 100644\n> --- a/commit-reach.c\n> +++ b/commit-reach.c\n> @@ -944,6 +944,8 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,\n>  \t\t}\n>  \t}\n>  \n> +\tclear_prio_queue(&queue);\n> +\n>  \tclear_commit_marks_many(nr_to, to, PARENT1);\n>  \tclear_commit_marks_many(nr_from, from, PARENT2);\n"},{"id":"478013","messageId":"21d3f105-ed32-e397-a1fe-53344894bd44@web.de","threadId":"59833","inReplyTo":"xmqqedmt7167.fsf@gitster.g","subject":"Re: [PATCH] Fix memory leak in get_reachable_subset","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2023-06-03T06:02:51Z","receivedAt":"2023-06-03T06:03:10Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 03.06.23 um 04:02 schrieb Junio C Hamano:\n> Mike Hommey <mh@glandium.org> writes:\n>\n>> Signed-off-by: Mike Hommey <mh@glandium.org>\n>> ---\n>\n> As most lines in the affected function seems to come from your\n> fcb2c076 (commit-reach: implement get_reachable_subset, 2018-11-02),\n> I'll redirect the review of this patch to you.\n\nStolee reviewed it already when the patch was sent the first time, here:\nhttps://lore.kernel.org/git/20230421234409.1925489-1-mh@glandium.org/T/#u\n\n>\n> Thanks.\n>\n>>  commit-reach.c | 2 ++\n>>  1 file changed, 2 insertions(+)\n>>\n>> diff --git a/commit-reach.c b/commit-reach.c\n>> index 70bde8af05..f15d84566b 100644\n>> --- a/commit-reach.c\n>> +++ b/commit-reach.c\n>> @@ -944,6 +944,8 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,\n>>  \t\t}\n>>  \t}\n>>\n>> +\tclear_prio_queue(&queue);\n\nMakes sense: The loop that dequeues would end before consuming all items\nwhen all \"to\" commits are found to be reachable.\n\n>> +\n>>  \tclear_commit_marks_many(nr_to, to, PARENT1);\n>>  \tclear_commit_marks_many(nr_from, from, PARENT2);\n\n"},{"id":"478022","messageId":"xmqq7csj6dok.fsf@gitster.g","threadId":"59833","inReplyTo":"21d3f105-ed32-e397-a1fe-53344894bd44@web.de","subject":"Re: [PATCH] Fix memory leak in get_reachable_subset","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-06-04T04:42:35Z","receivedAt":"2023-06-04T04:42:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> Stolee reviewed it already when the patch was sent the first time, here:\n> https://lore.kernel.org/git/20230421234409.1925489-1-mh@glandium.org/T/#u\n\nOK.  Thanks.\n"},{"id":"478048","messageId":"221ddd01-c058-dd87-9f3f-25146770f606@github.com","threadId":"59833","inReplyTo":"xmqq7csj6dok.fsf@gitster.g","subject":"Re: [PATCH] Fix memory leak in get_reachable_subset","fromName":"Derrick Stolee","fromEmail":"derrickstolee@github.com","sentAt":"2023-06-05T15:50:32Z","receivedAt":"2023-06-05T15:51:15Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 6/4/2023 12:42 AM, Junio C Hamano wrote:\n> René Scharfe <l.s.r@web.de> writes:\n> \n>> Stolee reviewed it already when the patch was sent the first time, here:\n>> https://lore.kernel.org/git/20230421234409.1925489-1-mh@glandium.org/T/#u\n> \n> OK.  Thanks.\n\nThanks for finding this link. I saw this patch and immediately thought,\n\"I made this mistake a _second_ time?\"\n\nThe patch continues to look good to me.\n\nThanks,\n-Stolee\n"}]}