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 11:20:00 -0700 |
| commit | 1b261c20ed28ad26ddbcd3dff94a248ac6866ac8 (patch) | |
| tree | 2b035eeafac8bc875b83bc643a0bff20aedd53c3 /config.h | |
| parent | builtin/log: stop using globals for format config (diff) | |
| download | git-1b261c20ed28ad26ddbcd3dff94a248ac6866ac8.tar.gz 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 'config.h')
| -rw-r--r-- | config.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -280,7 +280,7 @@ int git_config_bool(const char *, const char *); * Allocates and copies the value string into the `dest` parameter; if no * string is given, prints an error message and returns -1. */ -int git_config_string(const char **, const char *, const char *); +int git_config_string(char **, const char *, const char *); /** * Similar to `git_config_string`, but expands `~` or `~user` into the |
