From 4f8b3850b207c4a8adaaba6caf82902c90cee8b6 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 26 Sep 2022 15:13:02 +1000 Subject: duplicate -F switches would overwrite PL_splitstr without freeing Of course, it wasn't safe to free it before the previous patch, but it is now. --- t/run/switchF2.t | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 't') diff --git a/t/run/switchF2.t b/t/run/switchF2.t index 507459e3d8..5a434eb782 100644 --- a/t/run/switchF2.t +++ b/t/run/switchF2.t @@ -38,4 +38,14 @@ SKIP: }, "PL_splitstr freed in each thread"); } +{ + # old value of PL_splitstr wasn't freed with multiple switches (it wasn't safe to before) + # this would only fail under valgrind/LSAN + fresh_perl_is('print $F[1]', "b", + { + switches => [ "-F:", "-F," ], + stdin => "a,b,c", + }, "PL_splitstr freed on extra -F switch"); +} + done_testing(); -- cgit v1.2.1