diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-10-02 16:46:25 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-10-02 16:46:26 +0200 |
commit | 365529e1ea19b44a7a253b780f3ae3a1cb2f081f (patch) | |
tree | 5a34837f74d165858246b1dd9706b926d7a998e5 /submodule.c | |
parent | Merge branch 'ds/sparse-checkout-expansion-advice' (diff) | |
parent | diffcore-break: fix leaking filespecs when merging broken pairs (diff) | |
download | git-365529e1ea19b44a7a253b780f3ae3a1cb2f081f.tar.xz git-365529e1ea19b44a7a253b780f3ae3a1cb2f081f.zip |
Merge branch 'ps/leakfixes-part-7'
More leak-fixes.
* ps/leakfixes-part-7: (23 commits)
diffcore-break: fix leaking filespecs when merging broken pairs
revision: fix leaking parents when simplifying commits
builtin/maintenance: fix leak in `get_schedule_cmd()`
builtin/maintenance: fix leaking config string
promisor-remote: fix leaking partial clone filter
grep: fix leaking grep pattern
submodule: fix leaking submodule ODB paths
trace2: destroy context stored in thread-local storage
builtin/difftool: plug several trivial memory leaks
builtin/repack: fix leaking configuration
diffcore-order: fix leaking buffer when parsing orderfiles
parse-options: free previous value of `OPTION_FILENAME`
diff: fix leaking orderfile option
builtin/pull: fix leaking "ff" option
dir: fix off by one errors for ignored and untracked entries
builtin/submodule--helper: fix leaking remote ref on errors
t/helper: fix leaking subrepo in nested submodule config helper
builtin/submodule--helper: fix leaking error buffer
builtin/submodule--helper: clear child process when not running it
submodule: fix leaking update strategy
...
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c index 4e71ac0dfd..74d5766f07 100644 --- a/submodule.c +++ b/submodule.c @@ -175,11 +175,11 @@ void stage_updated_gitmodules(struct index_state *istate) die(_("staging updated .gitmodules failed")); } -static struct string_list added_submodule_odb_paths = STRING_LIST_INIT_NODUP; +static struct string_list added_submodule_odb_paths = STRING_LIST_INIT_DUP; void add_submodule_odb_by_path(const char *path) { - string_list_insert(&added_submodule_odb_paths, xstrdup(path)); + string_list_insert(&added_submodule_odb_paths, path); } int register_all_submodule_odb_as_alternates(void) @@ -424,6 +424,11 @@ int parse_submodule_update_strategy(const char *value, return 0; } +void submodule_update_strategy_release(struct submodule_update_strategy *strategy) +{ + free((char *) strategy->command); +} + const char *submodule_update_type_to_string(enum submodule_update_type type) { switch (type) { |