From 1b261c20ed28ad26ddbcd3dff94a248ac6866ac8 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 27 May 2024 13:46:39 +0200 Subject: config: clarify memory ownership in `git_config_string()` The out parameter of `git_config_string()` 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 Signed-off-by: Junio C Hamano --- environment.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'environment.h') diff --git a/environment.h b/environment.h index be1b88ad6f..e9f01d4d11 100644 --- a/environment.h +++ b/environment.h @@ -224,11 +224,11 @@ int odb_pack_keep(const char *name); const char *get_log_output_encoding(void); const char *get_commit_output_encoding(void); -extern const char *git_commit_encoding; -extern const char *git_log_output_encoding; +extern char *git_commit_encoding; +extern char *git_log_output_encoding; -extern const char *editor_program; -extern const char *askpass_program; +extern char *editor_program; +extern char *askpass_program; extern char *excludes_file; /* -- cgit 1.2.3-korg