From: Michal 'vorner' Vaner Date: Mon, 19 Nov 2012 16:33:08 +0000 (+0100) Subject: [2375] Use safety measures X-Git-Tag: bind10-1.0.0-beta-release~84^2~3^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9a8f7668e65dc98e7fa7699ce906efe78f4daf8;p=thirdparty%2Fkea.git [2375] Use safety measures A scoped pointer, in this case. It probably isn't safer, as the ->handle couldn't throw in this case, but just for the habit. --- diff --git a/src/lib/dns/tests/master_lexer_unittest.cc b/src/lib/dns/tests/master_lexer_unittest.cc index 2eb0c3a9ae..1c6e77549a 100644 --- a/src/lib/dns/tests/master_lexer_unittest.cc +++ b/src/lib/dns/tests/master_lexer_unittest.cc @@ -178,9 +178,9 @@ TEST_F(MasterLexerTest, tokenFromStart) { // We don't have access directly inside the implementation. // We get the fake state, run it to install the token. // Then we just delete it ourself and return NULL. - State* state(State::getFakeState(NULL, 0, &token_)); + scoped_ptr state(State::getFakeState(NULL, 0, + &token_)); state->handle(*this); - delete state; return (NULL); } private: