Re: [PATCH 1/2] unix-socket: fix memory leak when chdir(3p) fails
- From
Jeff King <peff@peff.net>
- Date
- Jan 29, 2025, 20:07 UTC
- Message-ID
- <20250129200702.GB2331283@coredump.intra.peff.net>
- In-Reply-To
- <xmqq34h1k02k.fsf@gitster.g>
On Wed, Jan 29, 2025 at 09:21:39AM -0800, Junio C Hamano wrote:
Show 16 quoted lines
> > This leads to a memory leak: when we have already populated the context > > with the original directory that we need to chdir(3p) back into, but > > then the chdir(3p) into the socket's parent directory fails, then we > > won't release the original directory's path. The leak is exposed by > > t0301, but only via Meson with `meson setup -Dsanitize=leak`: > > Did you mean > > $ meson configure -Db_sanitize=leak > $ meson test t0301-credential-cache > > I'll need to figure out how to make various tweaks at runtime > working with meson based build tree. The next thing I need to > figure out is to see how to get verbose error output from the tests, > as I cannot just go back to the source tree and say "cd t && sh > t0301-credential-cache -v -i -x" because the build is out of tree.
I did:
GIT_BUILD_DIR=$PWD/../build ./t0301-credential-cache.sh -v -i
but I don't know if there's an easier way from meson.
(The "b_" prefix on "sanitize" confused me as well after reading the commit message).
-Peff