summaryrefslogtreecommitdiffstats
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-05-07 05:47:41 +0200
committerJunio C Hamano <gitster@pobox.com>2021-05-07 05:47:41 +0200
commit936e58851af0324d408c9e1a70cddd288d892a45 (patch)
tree6c0eaca13d0c6f4d7343d773a994441b042d1729 /builtin/checkout.c
parentMerge branch 'ps/rev-list-object-type-filter' (diff)
parentbuiltin/rm: avoid leaking pathspec and seen (diff)
downloadgit-936e58851af0324d408c9e1a70cddd288d892a45.tar.xz
git-936e58851af0324d408c9e1a70cddd288d892a45.zip
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/checkout.c')
-rw-r--r--builtin/checkout.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 5bd9128d1a..4d19c35d83 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -607,6 +607,7 @@ static void show_local_changes(struct object *head,
diff_setup_done(&rev.diffopt);
add_pending_object(&rev, head, NULL);
run_diff_index(&rev, 0);
+ object_array_clear(&rev.pending);
}
static void describe_detached_head(const char *msg, struct commit *commit)