Skip to content

Commit

Permalink
Fix memory leak in run_tests()
Browse files Browse the repository at this point in the history
  • Loading branch information
PilzAdam committed May 14, 2013
1 parent 4a95c37 commit d5ca3b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/test.cpp
Expand Up @@ -1772,6 +1772,10 @@ void run_tests()
TEST(TestConnection);
dout_con<<"=== END RUNNING UNIT TESTS FOR CONNECTION ==="<<std::endl;
}

delete idef;
delete ndef;

if(tests_failed == 0){
infostream<<"run_tests(): "<<tests_failed<<" / "<<tests_run<<" tests failed."<<std::endl;
infostream<<"run_tests() passed."<<std::endl;
Expand All @@ -1781,7 +1785,5 @@ void run_tests()
errorstream<<"run_tests() aborting."<<std::endl;
abort();
}
delete idef;
delete ndef;
}

0 comments on commit d5ca3b7

Please sign in to comment.