From: Junio C Hamano <gitster@pobox.com>
To: Han Young <hanyang.tony@bytedance.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/1] diffcore-break: prevent dangling pointer
Date: Wed, 11 Feb 2026 09:54:00 -0800 [thread overview]
Message-ID: <xmqqfr77upxj.fsf@gitster.g> (raw)
In-Reply-To: <20260211041128.48412-2-hanyang.tony@bytedance.com> (Han Young's message of "Wed, 11 Feb 2026 12:11:28 +0800")
Han Young <hanyang.tony@bytedance.com> writes:
> After we have freed the file pair, we should set the queue reference to null.
> This prevents us from encountering a dangling pointer later on.
> ---
> diffcore-break.c | 1 +
> 1 file changed, 1 insertion(+)
Missing are sign-off and tests.
This reminds me of 56d388e6 (diff: avoid segfault with freed
entries, 2025-12-29).
>
> diff --git a/diffcore-break.c b/diffcore-break.c
> index c4c2173f30..9b11fe2fa0 100644
> --- a/diffcore-break.c
> +++ b/diffcore-break.c
> @@ -222,6 +222,7 @@ void diffcore_break(struct repository *r, int break_score)
> free(p); /* not diff_free_filepair(), we are
> * reusing one and two here.
> */
> + q->queue[i] = NULL;
> continue;
> }
> }
next prev parent reply other threads:[~2026-02-11 17:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 4:11 [PATCH 0/1] diffcore-break: prevent dangling pointer Han Young
2026-02-11 4:11 ` [PATCH 1/1] " Han Young
2026-02-11 17:54 ` Junio C Hamano [this message]
2026-02-12 7:20 ` [PATCH v2 0/1] " Han Young
2026-02-12 7:20 ` [PATCH v2 1/1] " Han Young
2026-02-12 18:58 ` Junio C Hamano
2026-02-13 7:14 ` [External] " Han Young
2026-02-13 17:16 ` Junio C Hamano
2026-02-24 6:13 ` [PATCH v3 0/1] diffcore-break: avoid segfault with freed entries Han Young
2026-02-24 6:13 ` [PATCH v3 1/1] " Han Young
2026-02-24 15:22 ` [PATCH v3 0/1] " Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqfr77upxj.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=hanyang.tony@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox