From: Patrick Steinhardt Date: Thu, 06 Jun 2024 10:03:07 GMT Subject: Re: [PATCH v4 12/27] object-file: mark cached object buffers as const Message-ID: In-Reply-To: On Wed, Jun 05, 2024 at 11:10:20PM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > >> + co_buf = xmalloc(len); > >> + memcpy(co_buf, buf, len); > >> > >> hash_object_file(the_hash_algo, buf, len, type, oid); > >> if (repo_has_object_file_with_flags(the_repository, oid, OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT) || > > > > There is an early return around here. Perhaps we are leaking co_buf > > when we hit it? > > Indeed, that seems to be the case. With the attached at the tip of > the branch and rebuilding 'seen' seems to pass these 6130, 7010, 8002 > tests with SANTIZE=leak. Indeed, thanks. Rolled into my local version now. Patrick