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>
This commit is contained in:

committed by
Junio C Hamano

parent
83024d98f7
commit
1b261c20ed
@ -306,7 +306,7 @@ static int git_sequencer_config(const char *k, const char *v,
|
||||
}
|
||||
|
||||
if (!opts->default_strategy && !strcmp(k, "pull.twohead")) {
|
||||
int ret = git_config_string((const char**)&opts->default_strategy, k, v);
|
||||
int ret = git_config_string(&opts->default_strategy, k, v);
|
||||
if (ret == 0) {
|
||||
/*
|
||||
* pull.twohead is allowed to be multi-valued; we only
|
||||
|
Reference in New Issue
Block a user