diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-05-27 13:46:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-27 20:20:00 +0200 |
commit | 1b261c20ed28ad26ddbcd3dff94a248ac6866ac8 (patch) | |
tree | 2b035eeafac8bc875b83bc643a0bff20aedd53c3 /merge-ll.c | |
parent | builtin/log: stop using globals for format config (diff) | |
download | git-1b261c20ed28ad26ddbcd3dff94a248ac6866ac8.tar.xz git-1b261c20ed28ad26ddbcd3dff94a248ac6866ac8.zip |
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ll.c')
-rw-r--r-- | merge-ll.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/merge-ll.c b/merge-ll.c index bf1077ae09..e29b15fa4a 100644 --- a/merge-ll.c +++ b/merge-ll.c @@ -27,9 +27,9 @@ typedef enum ll_merge_result (*ll_merge_fn)(const struct ll_merge_driver *, struct ll_merge_driver { const char *name; - const char *description; + char *description; ll_merge_fn fn; - const char *recursive; + char *recursive; struct ll_merge_driver *next; char *cmdline; }; @@ -268,7 +268,7 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn, * merge.default and merge.driver configuration items */ static struct ll_merge_driver *ll_user_merge, **ll_user_merge_tail; -static const char *default_ll_merge; +static char *default_ll_merge; static int read_merge_config(const char *var, const char *value, const struct config_context *ctx UNUSED, |