diff options
| author | J08nY | 2018-02-03 20:09:25 +0100 |
|---|---|---|
| committer | J08nY | 2018-02-03 20:09:25 +0100 |
| commit | ed7e99ebc7c50523e5a2c6f21c8f89028348da71 (patch) | |
| tree | 8e153607291099ebbaf0833a0e0db09dc9a5ed2c /test/src/util/test_timeout.c | |
| parent | cfdddb2a57ad77f485eb4be1a52efe5ffe19a220 (diff) | |
| download | ecgen-ed7e99ebc7c50523e5a2c6f21c8f89028348da71.tar.gz ecgen-ed7e99ebc7c50523e5a2c6f21c8f89028348da71.tar.zst ecgen-ed7e99ebc7c50523e5a2c6f21c8f89028348da71.zip | |
Fix Valgrind warnings about timeout struct allocations.
- Make them dynamically allocated, per thread, not on stack.
- Also fix a small invalid read of deallocated generator point.
Diffstat (limited to '')
| -rw-r--r-- | test/src/util/test_timeout.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/src/util/test_timeout.c b/test/src/util/test_timeout.c index 21a13b0..adf9b2a 100644 --- a/test/src/util/test_timeout.c +++ b/test/src/util/test_timeout.c @@ -12,7 +12,12 @@ void timeout_setup(void) { timeout_init(); } -TestSuite(timeout, .init = timeout_setup, .fini = default_teardown); +void timeout_teardown(void) { + default_teardown(); + timeout_quit(); +} + +TestSuite(timeout, .init = timeout_setup, .fini = timeout_teardown); Test(timeout, test_timeout_stop) { bool done = false; |
