summaryrefslogtreecommitdiff
path: root/tests/Gtest-trace.c
diff options
context:
space:
mode:
authorTommi Rantala <tt.rantala@gmail.com>2012-09-17 13:27:30 +0300
committerTommi Rantala <tt.rantala@gmail.com>2012-09-28 14:50:02 +0300
commit0d7738ed4f7dae1b6b77d1a4dd25c5ea765de81f (patch)
tree03e17486e5efaba6ca74e7b31f722e05c337875e /tests/Gtest-trace.c
parent438d9de675771faaceaec362fbf4cf37eb06e295 (diff)
downloadlibunwind-0d7738ed4f7dae1b6b77d1a4dd25c5ea765de81f.tar.gz
Cleanup dynamically allocated memory before exit in tests
Cleanup dynamically allocated memory before exit in tests in a few places where missing. While such cleanups right before exit do not usually make much sense (as the operating system would cleanup anyway, so manual cleanups only burn CPU cycles), we will want to catch any potential problems in libunwind related to the cleanups. This also stops valgrind complaining about unreleased memory.
Diffstat (limited to 'tests/Gtest-trace.c')
-rw-r--r--tests/Gtest-trace.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/Gtest-trace.c b/tests/Gtest-trace.c
index 9d43ce21..e8dd9894 100644
--- a/tests/Gtest-trace.c
+++ b/tests/Gtest-trace.c
@@ -267,5 +267,11 @@ main (int argc, char **argv __attribute__((unused)))
if (verbose)
printf ("SUCCESS.\n");
+
+ signal (SIGTERM, SIG_DFL);
+ stk.ss_flags = SS_DISABLE;
+ sigaltstack (&stk, NULL);
+ free (stk.ss_sp);
+
return 0;
}