Skip to content

Commit a5a4cb7

Browse files
rscharfegitster
authored andcommitted
diff-lib: stop calling diff_setup_done() in do_diff_cache()
d44e526 (diff-lib: plug minor memory leaks in do_diff_cache(), 2020-11-14) added the call to diff_setup_done() to release the memory of the parseopt member of struct diff_options that repo_init_revisions() had allocated via repo_diff_setup() and prep_parse_options(). 189e97b (diff: remove parseopts member from struct diff_options, 2022-12-01) did away with that allocation; diff_setup_done() doesn't release any memory anymore. So stop calling this function on the blank diffopt member before it is overwritten, as this is no longer necessary. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ab91f6b commit a5a4cb7

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

diff-lib.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
641641

642642
repo_init_revisions(opt->repo, &revs, NULL);
643643
copy_pathspec(&revs.prune_data, &opt->pathspec);
644-
diff_setup_done(&revs.diffopt);
645644
revs.diffopt = *opt;
646645

647646
if (diff_cache(&revs, tree_oid, NULL, 1))

0 commit comments

Comments
 (0)