]> git.ipfire.org Git - thirdparty/git.git/commitdiff
diff-lib: stop calling diff_setup_done() in do_diff_cache()
authorRené Scharfe <l.s.r@web.de>
Wed, 1 May 2024 10:26:16 +0000 (12:26 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 May 2024 16:44:10 +0000 (09:44 -0700)
d44e5267ea (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().

189e97bc4b (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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c

index 2edea41a2345af623017d43e14a74d71a32bb873..b22394ea7172ca088f0c17ac9254b1db28ed6a23 100644 (file)
@@ -641,7 +641,6 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
 
        repo_init_revisions(opt->repo, &revs, NULL);
        copy_pathspec(&revs.prune_data, &opt->pathspec);
-       diff_setup_done(&revs.diffopt);
        revs.diffopt = *opt;
 
        if (diff_cache(&revs, tree_oid, NULL, 1))