diff --git a/builtin/rm.c b/builtin/rm.c index 4858631e0f02c5..2927678d37b6a5 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -327,6 +327,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix) if (!seen_any) exit(0); } + clear_pathspec(&pathspec); + free(seen); if (!index_only) submodules_absorb_gitdir_if_needed();