Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-28 00:04:49 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-28 00:04:49 +0300
commit0d9a8e33f9fd07efa10072576df01a9cae5d89e6 (patch)
tree5a01c05bf4d8e6d775c4843e5c760e81be4a780b /config.h
parentedab8a8d07eff5771ad08e7d2935f5df992c2c45 (diff)
parent55fe225dde455ae32b9bc963bef4aabb9f5f7c3e (diff)
Merge branch 'jk/leakfix'
Code clean-up. * jk/leakfix: submodule--helper: fix leak of core.worktree value config: fix leak in git_config_get_expiry_in_days() config: drop git_config_get_string_const() config: fix leaks from git_config_get_string_const() checkout: fix leak of non-existent branch names submodule--helper: use strbuf_release() to free strbufs clear_pattern_list(): clear embedded hashmaps
Diffstat (limited to 'config.h')
-rw-r--r--config.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/config.h b/config.h
index 060874488f..91cdfbfb41 100644
--- a/config.h
+++ b/config.h
@@ -458,8 +458,8 @@ void git_configset_clear(struct config_set *cs);
*/
int git_configset_get_value(struct config_set *cs, const char *key, const char **dest);
-int git_configset_get_string_const(struct config_set *cs, const char *key, const char **dest);
int git_configset_get_string(struct config_set *cs, const char *key, char **dest);
+int git_configset_get_string_tmp(struct config_set *cs, const char *key, const char **dest);
int git_configset_get_int(struct config_set *cs, const char *key, int *dest);
int git_configset_get_ulong(struct config_set *cs, const char *key, unsigned long *dest);
int git_configset_get_bool(struct config_set *cs, const char *key, int *dest);
@@ -474,10 +474,10 @@ int repo_config_get_value(struct repository *repo,
const char *key, const char **value);
const struct string_list *repo_config_get_value_multi(struct repository *repo,
const char *key);
-int repo_config_get_string_const(struct repository *repo,
- const char *key, const char **dest);
int repo_config_get_string(struct repository *repo,
const char *key, char **dest);
+int repo_config_get_string_tmp(struct repository *repo,
+ const char *key, const char **dest);
int repo_config_get_int(struct repository *repo,
const char *key, int *dest);
int repo_config_get_ulong(struct repository *repo,
@@ -529,13 +529,14 @@ void git_config_clear(void);
* error message and returns -1. When the configuration variable `key` is
* not found, returns 1 without touching `dest`.
*/
-int git_config_get_string_const(const char *key, const char **dest);
+int git_config_get_string(const char *key, char **dest);
/**
- * Similar to `git_config_get_string_const`, except that retrieved value
- * copied into the `dest` parameter is a mutable string.
+ * Similar to `git_config_get_string`, but does not allocate any new
+ * memory; on success `dest` will point to memory owned by the config
+ * machinery, which could be invalidated if it is discarded and reloaded.
*/
-int git_config_get_string(const char *key, char **dest);
+int git_config_get_string_tmp(const char *key, const char **dest);
/**
* Finds and parses the value to an integer for the configuration variable