From d5db4d25dc675e52f0ee7159321ef3bbea594a4d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 27 Apr 2017 12:47:47 +0200 Subject: [PATCH] test: cleanup handles in test_environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test fixtures create multiple node::Environments that all use the uv_default_loop(), and since the test does not clean up the handles created by Environment::Start(), the default libuv loop structure contains dangling pointers after the first Environment is freed, which then means that creating new handles leads to memory corruption. PR-URL: https://github.com/nodejs/node/pull/12621 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: Gibson Fahnestock Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: Michaƫl Zasso --- test/cctest/test_environment.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index a7579ac1167151..79bfbf50b45c03 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -42,6 +42,7 @@ class EnvironmentTest : public NodeTestFixture { ~Env() { FreeIsolateData(isolate_data_); + environment_->CleanupHandles(); FreeEnvironment(environment_); }