aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-02-23 17:16:45 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-02-23 17:17:07 +0100
commitacd1e6155ca62a6d91ca8d5eb23ea64f94d098b5 (patch)
tree6e2e5174c510ecbe8741fb22c59e5f6b26e21e56 /src/test
parent28b8061d9f1c0a44bf3dff4d47f01187e861b1b0 (diff)
parentfadb39ca6237781346ca3da319e2bd9e48a5a604 (diff)
Merge #12477: test: Plug memory leaks and stack-use-after-scope
fadb39c test: Plug memory leaks and stack-use-after-scope (MarcoFalke) Pull request description: Tree-SHA512: 7bd6bbba43c7870bbd9732d73ecfc520f21701168e6fb4ad099a08ea5b21d9cd09215e70d22fb92a1af03993204ef89ad74b3e80d9fa5a10831c3e7cf2dd04cd
Diffstat (limited to 'src/test')
-rw-r--r--src/test/checkqueue_tests.cpp8
-rw-r--r--src/test/test_bitcoin.cpp3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/test/checkqueue_tests.cpp b/src/test/checkqueue_tests.cpp
index 42f9dd0600..8e0ec5243b 100644
--- a/src/test/checkqueue_tests.cpp
+++ b/src/test/checkqueue_tests.cpp
@@ -406,11 +406,11 @@ BOOST_AUTO_TEST_CASE(test_CheckQueueControl_Locks)
boost::thread_group tg;
std::mutex m;
std::condition_variable cv;
+ bool has_lock{false};
+ bool has_tried{false};
+ bool done{false};
+ bool done_ack{false};
{
- bool has_lock {false};
- bool has_tried {false};
- bool done {false};
- bool done_ack {false};
std::unique_lock<std::mutex> l(m);
tg.create_thread([&]{
CCheckQueueControl<FakeCheck> control(queue.get());
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index bdd44489f4..95c4825b84 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -28,6 +28,9 @@ void CConnmanTest::AddNode(CNode& node)
void CConnmanTest::ClearNodes()
{
LOCK(g_connman->cs_vNodes);
+ for (CNode* node : g_connman->vNodes) {
+ delete node;
+ }
g_connman->vNodes.clear();
}