Parcourir la source

[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.
Michal 'vorner' Vaner il y a 12 ans
Parent
commit
f9a8f7668e
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/lib/dns/tests/master_lexer_unittest.cc

+ 2 - 2
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<const State> state(State::getFakeState(NULL, 0,
+                                                              &token_));
             state->handle(*this);
-            delete state;
             return (NULL);
         }
     private: