From: Junio C Hamano Date: Wed, 7 Apr 2021 23:54:08 +0000 (-0700) Subject: Merge branch 'ah/plugleaks' X-Git-Tag: v2.32.0-rc0~109 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=642a40019c99a42f5f4ed4f3e52b9ab92cd75fe7;p=thirdparty%2Fgit.git Merge branch 'ah/plugleaks' Plug or annotate remaining leaks that trigger while running the very basic set of tests. * ah/plugleaks: transport: also free remote_refs in transport_disconnect() parse-options: don't leak alias help messages parse-options: convert bitfield values to use binary shift init-db: silence template_dir leak when converting to absolute path init: remove git_init_db_config() while fixing leaks worktree: fix leak in dwim_branch() clone: free or UNLEAK further pointers when finished reset: free instead of leaking unneeded ref symbolic-ref: don't leak shortened refname in check_symref() --- 642a40019c99a42f5f4ed4f3e52b9ab92cd75fe7 diff --cc builtin/init-db.c index f82efe4aff,efc66523e2..c19b35f1e6 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@@ -212,12 -200,8 +200,9 @@@ static int create_default_files(const c int reinit; int filemode; struct strbuf err = STRBUF_INIT; + const char *init_template_dir = NULL; + const char *work_tree = get_git_work_tree(); - /* Just look for `init.templatedir` */ - init_db_template_dir = NULL; /* re-set in case it was set before */ - git_config(git_init_db_config, NULL); - /* * First copy the templates -- we might have the default * config file there, in which case we would want to read