test: Plug memory leaks and stack-use-after-scope

This commit is contained in:
MarcoFalke 2018-02-17 14:29:56 -05:00
parent 27c59dc502
commit fadb39ca62
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
3 changed files with 13 additions and 9 deletions

View file

@ -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();
}