diff options
author | Elijah Newren <newren@gmail.com> | 2021-09-27 18:33:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-27 22:38:37 +0200 |
commit | c512d27e787e9eb325731ab6aa7ac126f8cf6126 (patch) | |
tree | 2d07b5058c40a43be661004080406769e728a0f5 /builtin/read-tree.c | |
parent | t2500: add various tests for nuking untracked files (diff) | |
download | git-c512d27e787e9eb325731ab6aa7ac126f8cf6126.tar.xz git-c512d27e787e9eb325731ab6aa7ac126f8cf6126.zip |
checkout, read-tree: fix leak of unpack_trees_options.dir
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/read-tree.c')
-rw-r--r-- | builtin/read-tree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/read-tree.c b/builtin/read-tree.c index 485e7b0479..96102c222b 100644 --- a/builtin/read-tree.c +++ b/builtin/read-tree.c @@ -250,6 +250,11 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix) if (unpack_trees(nr_trees, t, &opts)) return 128; + if (opts.dir) { + dir_clear(opts.dir); + FREE_AND_NULL(opts.dir); + } + if (opts.debug_unpack || opts.dry_run) return 0; /* do not write the index out */ |