Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-03-20 09:16:07 +0300
committerJunio C Hamano <gitster@pobox.com>2019-03-20 09:16:07 +0300
commit6b5688b760a11430586122173d96b15fd3204308 (patch)
treeddb27de68f656862e068bb51b97967c3afea6b31 /builtin
parent83b13e284ce3e349aedfc48fc0fb885c390bb18b (diff)
parente8805af1c33d79750a979014c021cd63d780c720 (diff)
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`
Diffstat (limited to 'builtin')
-rw-r--r--builtin/init-db.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 93eff7618c..6090217025 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -96,7 +96,7 @@ static void copy_templates(const char *template_dir)
struct strbuf path = STRBUF_INIT;
struct strbuf template_path = STRBUF_INIT;
size_t template_len;
- struct repository_format template_format;
+ struct repository_format template_format = REPOSITORY_FORMAT_INIT;
struct strbuf err = STRBUF_INIT;
DIR *dir;
char *to_free = NULL;
@@ -148,6 +148,7 @@ free_return:
free(to_free);
strbuf_release(&path);
strbuf_release(&template_path);
+ clear_repository_format(&template_format);
}
static int git_init_db_config(const char *k, const char *v, void *cb)