From 257a0bf128e109442dce91c4aaa1d97fed17ad1a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 19 Mar 2025 12:32:10 +0300 Subject: fixed leaking data on rubout * Objects, that are restored with TECO_DEFINE_UNDO_OBJECT_OWN(), could actually leak memory on rubout since the old object was not deleted when overwriting it. * Now that it is, it is crucial to at least nullify objects/pointers after calling the corresponding push-function. These conditions are now explicitly documented. * The test suite now runs successfully under Valgrind even with full leak checking. --- tests/testsuite.at | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/testsuite.at b/tests/testsuite.at index 05ec2e3..86f8331 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -287,6 +287,9 @@ AT_CHECK([$SCITECO -e '2'], 0, ignore, stderr) AT_FAIL_IF([$GREP "^Warning:" stderr]) # Will print a warning about label redefinition, though... AT_CHECK([$SCITECO -e "!foo! Qa\"S^C' !foo! Qa\"S(0/0)' -Ua @O/foo/"], 0, ignore, ignore) +# This should not leak memory or cause memory corruptions when running under +# Valgrind or Asan: +AT_CHECK([$SCITECO_CMDLINE "!foo!{-5D}"], 0, ignore, stderr) AT_CLEANUP # -- cgit v1.2.3