From 12dfc2475ce4808df696fb67fc71a66793f78f06 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 26 Sep 2024 13:47:08 +0200 Subject: diffcore-break: fix leaking filespecs when merging broken pairs When merging file pairs after they have been broken up we queue a new file pair and discard the broken-up ones. The newly-queued file pair reuses one filespec of the broken up pairs each, where the respective other filespec gets discarded. But we only end up freeing the filespec's data, not the filespec itself, and thus leak memory. Fix these leaks by using `free_filespec()` instead. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- t/t4031-diff-rewrite-binary.sh | 1 + 1 file changed, 1 insertion(+) (limited to 't/t4031-diff-rewrite-binary.sh') diff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh index c4394a27b5..1b8cd3e4c9 100755 --- a/t/t4031-diff-rewrite-binary.sh +++ b/t/t4031-diff-rewrite-binary.sh @@ -2,6 +2,7 @@ test_description='rewrite diff on binary file' +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh # We must be large enough to meet the MINIMUM_BREAK_SIZE -- cgit 1.2.3-korg