Re: [PATCH v2 1/6] remote: fix tear down of struct branch and struct remote
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 18, 2025, 01:30 UTC
- Message-ID
- <xmqqldppu98s.fsf@gitster.g>
- In-Reply-To
- <d72fb411-2e05-441e-aee4-d8a26d652fea@intel.com>
Jacob Keller <jacob.e.keller@intel.com> writes:
Show 7 quoted lines
> We initialize branch->merge with set_merge() which is called by > branch_get() and which is the only way for callers external to remote.c > of getting a branch structure. > > The issue is that merge_nr can be non-zero because if no caller has done > a branch_get() on the given branch, we still have merge_nr is non-zero > and merge is NULL.
Meaning merge_nr and merge are both uninitialized and unlikely to be 0 and NULL? What values do they have, and if they are left uninitialized, shouldn't we be initializing them to predictable values?