From: Johannes Schindelin Date: Sat, 04 Jul 2026 08:58:45 GMT Subject: Re: [PATCH 01/13] load_one_loose_object_map(): fix resource leak Message-ID: <9dd7e482-5a4d-b75d-56a4-2c422cbd8812@gmx.de> In-Reply-To: Hi Junio, On Wed, 1 Jul 2026, Junio C Hamano wrote: > "Johannes Schindelin via GitGitGadget" > writes: > > > + ret = 0; > > Or we can do > > ret = ferror(fp) ? -1 : 0; > > if we want to be sure that we have caught all the errors. Agreed; that is what v2 will use. To corroborate the diagnosis: `strbuf_getline_lf()` ultimately calls `getdelim()`, which returns -1 on both EOF and I/O error, so `ferror(fp)` on the underlying stream is the only reliable way to distinguish the two. That also makes the `errno = 0;` I had added at the top of the loop dead, so it goes away in v2. Ciao, Johannes