Re: [PATCH v3 14/25] setup_discovered_git_dir(): plug memory leak

2017-05-03 Thread Johannes Schindelin
Hi Peff, On Tue, 2 May 2017, Jeff King wrote: > On Tue, May 02, 2017 at 10:20:29AM -0700, Stefan Beller wrote: > > > > - gitdir = real_pathdup(gitdir, 1); > > > + gitdir = to_free = real_pathdup(gitdir, 1); > > > if (chdir(cwd->buf)) >

Re: [PATCH v3 14/25] setup_discovered_git_dir(): plug memory leak

2017-05-02 Thread Jeff King
On Tue, May 02, 2017 at 10:20:29AM -0700, Stefan Beller wrote: > > - gitdir = real_pathdup(gitdir, 1); > > + gitdir = to_free = real_pathdup(gitdir, 1); > > if (chdir(cwd->buf)) > > die_errno("Could not come back t

Re: [PATCH v3 14/25] setup_discovered_git_dir(): plug memory leak

2017-05-02 Thread Stefan Beller
On Tue, May 2, 2017 at 9:02 AM, Johannes Schindelin wrote: > The setup_explicit_git_dir() function does not take custody of the string > passed as first parameter; we have to release it if we turned the value of > git_dir into an absolute path. > > Signed-off-by: Johannes Schindelin > --- > setu

[PATCH v3 14/25] setup_discovered_git_dir(): plug memory leak

2017-05-02 Thread Johannes Schindelin
The setup_explicit_git_dir() function does not take custody of the string passed as first parameter; we have to release it if we turned the value of git_dir into an absolute path. Signed-off-by: Johannes Schindelin --- setup.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff