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.c | |
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.c')
-rw-r--r-- | environment.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/environment.c b/environment.c index a73ba9c12c..279ea3fd5e 100644 --- a/environment.c +++ b/environment.c @@ -46,8 +46,8 @@ const char *git_commit_encoding; const char *git_log_output_encoding; char *apply_default_whitespace; char *apply_default_ignorewhitespace; -const char *git_attributes_file; -const char *git_hooks_path; +char *git_attributes_file; +char *git_hooks_path; int zlib_compression_level = Z_BEST_SPEED; int pack_compression_level = Z_DEFAULT_COMPRESSION; int fsync_object_files = -1; @@ -60,7 +60,7 @@ size_t delta_base_cache_limit = 96 * 1024 * 1024; unsigned long big_file_threshold = 512 * 1024 * 1024; const char *editor_program; const char *askpass_program; -const char *excludes_file; +char *excludes_file; enum auto_crlf auto_crlf = AUTO_CRLF_FALSE; enum eol core_eol = EOL_UNSET; int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN; |