summaryrefslogtreecommitdiffstats
path: root/diff.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 /diff.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 'diff.c')
-rw-r--r--diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index ded9ac70df..902df9286a 100644
--- a/diff.c
+++ b/diff.c
@@ -58,7 +58,7 @@ static int diff_context_default = 3;
static int diff_interhunk_context_default;
static const char *diff_word_regex_cfg;
static const char *external_diff_cmd_cfg;
-static const char *diff_order_file_cfg;
+static char *diff_order_file_cfg;
int diff_auto_refresh_index = 1;
static int diff_mnemonic_prefix;
static int diff_no_prefix;