Re: [PATCH 10/13] remote.c: make match_refs() copy src ref before assigning to peer_ref
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Feb 24, 2009, 03:06 UTC
- Message-ID
- <76718490902231906n620aac40x5c0663fd420c7f39@mail.gmail.com>
- In-Reply-To
- <7vocwspqhc.fsf@gitster.siamese.dyndns.org>
On Mon, Feb 23, 2009 at 8:34 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> If this issue was present before you started touching the affected code, > it should come much earlier in the series than [10/13]. If on the other > hand this was introduced by earlier one in the series, the patch that > introduced the bug should be corrected in place in the sequence without > this patch.
This issue existed before, but the other callers of match_heads() only call it once before the process terminates, and don't bother to free what it returns. So those callers didn't notice. This topic introduces the first caller that calls match_heads() repeatedly, so it frees the returned ref list after it has copied out what it needs.
The change is independent and can be moved anywhere in the series, or even introduced as a patch independent of the series itself. Which would you prefer? (Actually, would you mind just applying it how you see fit?)
j.