diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-05-27 13:46:15 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-27 20:19:59 +0200 |
commit | 6073b3b5c37716c50244d635e7c358f41f43e286 (patch) | |
tree | 6d3663eeb79e31b729d5a51ef9028ccb58848d3e /environment.h | |
parent | http: refactor code to clarify memory ownership (diff) | |
download | git-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 'environment.h')
-rw-r--r-- | environment.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/environment.h b/environment.h index 0b2d457f07..be1b88ad6f 100644 --- a/environment.h +++ b/environment.h @@ -131,8 +131,8 @@ extern int warn_ambiguous_refs; extern int warn_on_object_refname_ambiguity; extern char *apply_default_whitespace; extern char *apply_default_ignorewhitespace; -extern const char *git_attributes_file; -extern const char *git_hooks_path; +extern char *git_attributes_file; +extern char *git_hooks_path; extern int zlib_compression_level; extern int pack_compression_level; extern size_t packed_git_window_size; @@ -229,7 +229,7 @@ extern const char *git_log_output_encoding; extern const char *editor_program; extern const char *askpass_program; -extern const char *excludes_file; +extern char *excludes_file; /* * Should we print an ellipsis after an abbreviated SHA-1 value |