From: Junio C Hamano Date: Wed, 20 Mar 2019 06:16:07 +0000 (+0900) Subject: Merge branch 'ma/clear-repository-format' X-Git-Tag: v2.22.0-rc0~137 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6b5688b760a11430586122173d96b15fd3204308 Merge branch 'ma/clear-repository-format' The setup code has been cleaned up to avoid leaks around the repository_format structure. * ma/clear-repository-format: setup: fix memory leaks with `struct repository_format` setup: free old value before setting `work_tree` --- 6b5688b760a11430586122173d96b15fd3204308 diff --cc setup.c index ca9e8a949e,ab6e8fd4c3..d0c958c3b2 --- a/setup.c +++ b/setup.c @@@ -1044,8 -1068,8 +1058,8 @@@ const char *setup_git_directory_gently( { static struct strbuf cwd = STRBUF_INIT; struct strbuf dir = STRBUF_INIT, gitdir = STRBUF_INIT; - const char *prefix; + const char *prefix = NULL; - struct repository_format repo_fmt; + struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT; /* * We may have read an incomplete configuration before