Skip to content

Commit ca06552

Browse files
committed
Merge branch 'rs/plug-diff-cache-leak'
Memleak fix. * rs/plug-diff-cache-leak: diff-lib: plug minor memory leaks in do_diff_cache()
2 parents 2ba70a3 + d44e526 commit ca06552

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

diff-lib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,10 +606,12 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
606606

607607
repo_init_revisions(opt->repo, &revs, NULL);
608608
copy_pathspec(&revs.prune_data, &opt->pathspec);
609+
diff_setup_done(&revs.diffopt);
609610
revs.diffopt = *opt;
610611

611612
if (diff_cache(&revs, tree_oid, NULL, 1))
612613
exit(128);
614+
clear_pathspec(&revs.prune_data);
613615
return 0;
614616
}
615617

0 commit comments

Comments
 (0)