summaryrefslogtreecommitdiffstats
path: root/t/t2016-checkout-patch.sh
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2024-04-23 00:54:05 +0200
committerJunio C Hamano <gitster@pobox.com>2024-04-23 01:27:42 +0200
commit71c791605365d1873ef631bfc478fcd75080a063 (patch)
treec09e487dc6fac2fab51dee9d08ef335684c7f7c0 /t/t2016-checkout-patch.sh
parentGit 2.45-rc0 (diff)
downloadgit-71c791605365d1873ef631bfc478fcd75080a063.tar.xz
git-71c791605365d1873ef631bfc478fcd75080a063.zip
apply: plug a leak in apply_data
We have an execution path in apply_data that leaks the local struct image. Plug it. This leak can be triggered with: $ echo foo >file $ git add file && git commit -m file $ echo bar >file $ git diff file >diff $ sed s/foo/frotz/ <diff >baddiff $ git apply --cached <baddiff Fixing this leak allows us to mark as leak-free the following tests: + t2016-checkout-patch.sh + t4103-apply-binary.sh + t4104-apply-boundary.sh + t4113-apply-ending.sh + t4117-apply-reject.sh + t4123-apply-shrink.sh + t4252-am-options.sh + t4258-am-quoted-cr.sh Mark them with "TEST_PASSES_SANITIZE_LEAK=true" to notice and fix promply any new leak that may be introduced and triggered by them in the future. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2016-checkout-patch.sh')
-rwxr-xr-xt/t2016-checkout-patch.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh
index c4f9bf09aa..c40b661ac1 100755
--- a/t/t2016-checkout-patch.sh
+++ b/t/t2016-checkout-patch.sh
@@ -2,6 +2,7 @@
test_description='git checkout --patch'
+TEST_PASSES_SANITIZE_LEAK=true
. ./lib-patch-mode.sh
test_expect_success 'setup' '