summaryrefslogtreecommitdiff
path: root/builtin/rm.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/rm.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/rm.c')
-rw-r--r--builtin/rm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/rm.c b/builtin/rm.c
index d89f241e97..8a24c715e0 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -342,6 +342,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
if (!seen_any)
exit(ret);
}
+ clear_pathspec(&pathspec);
+ free(seen);
if (!index_only)
submodules_absorb_gitdir_if_needed();