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 /userdiff.h | |
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 '')
-rw-r--r-- | userdiff.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/userdiff.h b/userdiff.h index d726804c3e..cc8e5abfef 100644 --- a/userdiff.h +++ b/userdiff.h @@ -7,19 +7,19 @@ struct index_state; struct repository; struct userdiff_funcname { - const char *pattern; + char *pattern; int cflags; }; struct userdiff_driver { const char *name; - const char *external; - const char *algorithm; + char *external; + char *algorithm; int binary; struct userdiff_funcname funcname; - const char *word_regex; - const char *word_regex_multi_byte; - const char *textconv; + char *word_regex; + char *word_regex_multi_byte; + char *textconv; struct notes_cache *textconv_cache; int textconv_want_cache; }; |