diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-09-26 13:47:08 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-09-27 08:25:37 -0700 |
| commit | 12dfc2475ce4808df696fb67fc71a66793f78f06 (patch) | |
| tree | c4f0e029443f3c29071d7d317d95aa2646eb66bb /t/t4008-diff-break-rewrite.sh | |
| parent | revision: fix leaking parents when simplifying commits (diff) | |
| download | git-12dfc2475ce4808df696fb67fc71a66793f78f06.tar.gz git-12dfc2475ce4808df696fb67fc71a66793f78f06.zip | |
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4008-diff-break-rewrite.sh')
| -rwxr-xr-x | t/t4008-diff-break-rewrite.sh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh index 562aaf3a2a..b0ef0026e0 100755 --- a/t/t4008-diff-break-rewrite.sh +++ b/t/t4008-diff-break-rewrite.sh @@ -21,6 +21,8 @@ With -B, this should be detected as two complete rewrites. Further, with -B and -M together, these should turn into two renames. ' + +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh . "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash |
