summaryrefslogtreecommitdiff
path: root/builtin/ls-files.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-05-07 12:47:41 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-05-07 12:47:41 +0900
commit936e58851af0324d408c9e1a70cddd288d892a45 (patch)
tree6c0eaca13d0c6f4d7343d773a994441b042d1729 /builtin/ls-files.c
parentMerge branch 'ps/rev-list-object-type-filter' (diff)
parentbuiltin/rm: avoid leaking pathspec and seen (diff)
downloadtgif-936e58851af0324d408c9e1a70cddd288d892a45.tar.xz
Merge branch 'ah/plugleaks'
Plug various leans reported by LSAN. * ah/plugleaks: builtin/rm: avoid leaking pathspec and seen builtin/rebase: release git_format_patch_opt too builtin/for-each-ref: free filter and UNLEAK sorting. mailinfo: also free strbuf lists when clearing mailinfo builtin/checkout: clear pending objects after diffing builtin/check-ignore: clear_pathspec before returning builtin/bugreport: don't leak prefixed filename branch: FREE_AND_NULL instead of NULL'ing real_ref bloom: clear each bloom_key after use ls-files: free max_prefix when done wt-status: fix multiple small leaks revision: free remainder of old commit list in limit_list
Diffstat (limited to 'builtin/ls-files.c')
-rw-r--r--builtin/ls-files.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index a0b4e54d11..ecaca5e2fe 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -607,7 +607,7 @@ static int option_parse_exclude_standard(const struct option *opt,
int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
{
int require_work_tree = 0, show_tag = 0, i;
- const char *max_prefix;
+ char *max_prefix;
struct dir_struct dir;
struct pattern_list *pl;
struct string_list exclude_list = STRING_LIST_INIT_NODUP;
@@ -785,5 +785,6 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
}
dir_clear(&dir);
+ free(max_prefix);
return 0;
}