summaryrefslogtreecommitdiffstats
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-27 13:46:15 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-27 20:19:59 +0200
commit6073b3b5c37716c50244d635e7c358f41f43e286 (patch)
tree6d3663eeb79e31b729d5a51ef9028ccb58848d3e /builtin/commit.c
parenthttp: refactor code to clarify memory ownership (diff)
downloadgit-6073b3b5c37716c50244d635e7c358f41f43e286.tar.xz
git-6073b3b5c37716c50244d635e7c358f41f43e286.zip
config: clarify memory ownership in `git_config_pathname()`
The out parameter of `git_config_pathname()` is a `const char **` even though we transfer ownership of memory to the caller. This is quite misleading and has led to many memory leaks all over the place. Adapt the parameter to instead be `char **`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 78bfae2164..1cc88e92bf 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -107,7 +107,7 @@ static enum {
} commit_style;
static const char *logfile, *force_author;
-static const char *template_file;
+static char *template_file;
/*
* The _message variables are commit names from which to take
* the commit message and/or authorship.