summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-07-08 14:53:10 -0700
committerJunio C Hamano <gitster@pobox.com>2024-07-08 14:53:10 -0700
commit3997614c249b4b475d07c00556446d8b698d1a49 (patch)
treefc0d71d047b303ec2b25fd0711069e9ba4751dd9 /help.c
parentecf7fc600a5218c9ee3863ee70d5a6e312164f30 (diff)
parentfbf7a46d881429ef5495af7bbf3a6c3dacbf80b3 (diff)
Merge branch 'ps/leakfixes-more'
More memory leaks have been plugged. * ps/leakfixes-more: (29 commits) builtin/blame: fix leaking ignore revs files builtin/blame: fix leaking prefixed paths blame: fix leaking data for blame scoreboards line-range: plug leaking find functions merge: fix leaking merge bases builtin/merge: fix leaking `struct cmdnames` in `get_strategy()` sequencer: fix memory leaks in `make_script_with_merges()` builtin/clone: plug leaking HEAD ref in `wanted_peer_refs()` apply: fix leaking string in `match_fragment()` sequencer: fix leaking string buffer in `commit_staged_changes()` commit: fix leaking parents when calling `commit_tree_extended()` config: fix leaking "core.notesref" variable rerere: fix various trivial leaks builtin/stash: fix leak in `show_stash()` revision: free diff options builtin/log: fix leaking commit list in git-cherry(1) merge-recursive: fix memory leak when finalizing merge builtin/merge-recursive: fix leaking object ID bases builtin/difftool: plug memory leaks in `run_dir_diff()` object-name: free leaking object contexts ...
Diffstat (limited to 'help.c')
-rw-r--r--help.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/help.c b/help.c
index de0bdd3c8e..a6b4d3b1eb 100644
--- a/help.c
+++ b/help.c
@@ -163,7 +163,7 @@ void add_cmdname(struct cmdnames *cmds, const char *name, int len)
cmds->names[cmds->cnt++] = ent;
}
-static void clean_cmdnames(struct cmdnames *cmds)
+void cmdnames_release(struct cmdnames *cmds)
{
int i;
for (i = 0; i < cmds->cnt; ++i)
@@ -365,8 +365,8 @@ void list_all_main_cmds(struct string_list *list)
for (i = 0; i < main_cmds.cnt; i++)
string_list_append(list, main_cmds.names[i]->name);
- clean_cmdnames(&main_cmds);
- clean_cmdnames(&other_cmds);
+ cmdnames_release(&main_cmds);
+ cmdnames_release(&other_cmds);
}
void list_all_other_cmds(struct string_list *list)
@@ -381,8 +381,8 @@ void list_all_other_cmds(struct string_list *list)
for (i = 0; i < other_cmds.cnt; i++)
string_list_append(list, other_cmds.names[i]->name);
- clean_cmdnames(&main_cmds);
- clean_cmdnames(&other_cmds);
+ cmdnames_release(&main_cmds);
+ cmdnames_release(&other_cmds);
}
void list_cmds_by_category(struct string_list *list,
@@ -695,7 +695,7 @@ const char *help_unknown_cmd(const char *cmd)
if (autocorrect && n == 1 && SIMILAR_ENOUGH(best_similarity)) {
const char *assumed = main_cmds.names[0]->name;
main_cmds.names[0] = NULL;
- clean_cmdnames(&main_cmds);
+ cmdnames_release(&main_cmds);
fprintf_ln(stderr,
_("WARNING: You called a Git command named '%s', "
"which does not exist."),